Skip to main content
gamedev.net
🔒 Locked

Executing an executable

Started by TheC00L1 5 replies 650+ views
Original Post
TheC00L1
TheC00L1
How does a person execute an executable in c++, i.e. run a program with in a prgram? Does it have to do wth the window shell? I was using _popen but it is iritating, and i feel like i'm using it wrong. Well, thanx in advance.
A wiseman once said nothing, but no one was there to hear it.
Enselic
Enselic
If you're running windows, use the system() call:
 system("C:\\Yada\\Yada.exe");


[Edited by - Enselic on June 4, 2006 1:08:56 AM]
wyrzy
wyrzy
spawnl( P_NOWAITO, "program_name.exe", "program_name.exe", 0 );

should be POSIX standard. I believe it works on Win32/Unix.
TheC00L1
TheC00L1
oh, sw33t!!! hey, is there any libs needed for these(i don't have a compiler with me at the momment)?
A wiseman once said nothing, but no one was there to hear it.
LessBread
LessBread
See also CreateProcess and ShellExecute
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes." - the Laughing Man
Replicon
Replicon
There's also fork/exec (wait, I have more of a linux background, does windows have the concept of 'exec', where a process kills itself and executes something else, but with the same pid?)
LessBread
LessBread
Nope, not that I'm aware of.
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes." - the Laughing Man

Topic Locked

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

Sign in to reply to this topic.