Skip to main content
GameDev.net gamedev.net
🔒 Locked

Run an Executable from a program

Started by dragon376 Nov 22, 2001 at 6:25 PM 1 replies 800+ views
Original Post
dragon376
dragon376
How can I start an executable file from withing a C/C++ program? Thanks
Fruny
Fruny
exec() (there are variants), or spawn() (windows only, *NIX use fork() and exec() )
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
KlePt0
KlePt0
If windows only.....

if you don''t need the process handle or the spawned thread id then you can use the simple ShellExecute.

Otherwise look into CreateProcess

both of which are well documented in MSDN
Bobby Ward - COM Guru in training

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.