views:

117

answers:

3

I am creating a simple GUI in C++ which have few buttons in it. I want to launch some external .exe files when i click on these buttons.

What's the code to achieve this?

+4  A: 

In its simplest form: system("c:\\path\\to\\binary.exe");.
If you need more control, use something like CreateProcess().

Georg Fritzsche
Thanks bro got it
RishiPatel
A: 

Take a look at CreateProcess(). You can also use system() but system() doesn't return until the process you called exits.

Andreas Bonini
+1  A: 

Avoid the system() solution, see this post for an explaination. You should use CreateProcess for executables and ShellExecute to open files with their associated application.

Matteo Italia