-
start another program
I want to write a program and under some condition to start another program. How I can start another program that is not in the same folder ??
I use system function, but it work for only in the same folder. Is there any other function which I can start another program not in the same folder ?
Thanks
[email protected]
-
You can use the system() function, here's an example:
Code:
#include <stdlib.h>
int main(void)
{
system("c:\\prog.exe");
return 0;
}
-
You can also use exec().
You would need to decide whether you want to replace the currently running process or launch a new process.
Hope this helps.
-