To execute the command in the same cmd.exe window where your C program is running:
#include <stdlib.h> . . . system("dir C:\\");
To start separate windows, you need to call cmd.exe :
system("cmd.exe /c dir c:\\");
(Note: I have not tested this);
thkala
source share