Reprinted from: Detailed explanation of system function under windows
Detailed explanation of system() function in C/C++
1. Create a new directory
system("md w:\wang\123");//Unable to create multi-level directories under linux system, it needs to be created cyclically
2. Assignment file
system("copy \"source directory\" \"dest directory\"");
Such as: note the red backslash
system(“move \”C:\DDSServer\Voc\FM101\37.WAV\” \”W:\DDSServer\Voc\FM975\2014_06_19\38_13.WAV\” “);
Preferably: char cmd[256]; sprintf(cmd,"copy %s%s",path1,path2);system(cmd);
or:char cmd[256];sprintf(cmd,"copy %s % s", "path1", "path2"); system(cmd);
3. Cut the file using move
Detailed explanation of system () function under windows
Detailed explanation of system () function under windows operating system (mainly in the application of C language) Function name: system
Function: Issue a DOS
command Usage: int system(char *command);
The system function has been included in the standard c library and can be called directly
Program example:
#include