cmd

I want to make a program in C++ that can perform cmd commands.
For example I want to copy a file with the cmd command copy but under my c++ program.

Thanks in advance
closed account (Gz64jE8b)
system();

Will allow you to use command prompt commands.
Do you mean to say, you want to be able to launch your program from wherever, and inside the program use a command line program, such as ipconfig or copy, or do you want to be able to be on the command line and type your program and have it execute?

For the first one
1
2
3
4
5
//...
#include <windows.h>
//...
system("copy C:\\file.txt file2.txt") //note the double backslash, because the first one is an escape, the second one is saying you want the backslash
//.. 
Thanks Mohammed for your help
Thanks Intrexa for the help
Topic archived. No new replies allowed.