Execute a program from inside another executable | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Execute a program from inside another executable

how can i make an executable file run another executable file? preferably in c++ on running a .exe file, it should run another .exe file present in the same directory.. what are the necessary c++ codes to be included?

27th Nov 2016, 4:29 PM
shaheer shukur
shaheer shukur - avatar
3 Answers
+ 2
This varies by the operating system. Take a look at the standard system function http://www.cplusplus.com/reference/cstdlib/system/.
27th Nov 2016, 4:38 PM
Igor B
Igor B - avatar
+ 2
#include <stdlib.h> int system(const char *command); Should work on Windows and linux systems.
27th Nov 2016, 5:38 PM
Mattias Eriksson
Mattias Eriksson - avatar
0
thanks :)
27th Nov 2016, 6:54 PM
shaheer shukur
shaheer shukur - avatar