Question??

Started by
3 comments, last by GameDev.net 24 years, 5 months ago
IIRC the ANSI C command is exec().

There's also an obsolete function called WinExec()... look it up in the docs and it should point you to the new way of doing it (CreateProcess, I think?)

Mason McCuskey
Spin Studios
www.spin-studios.com

Founder, Cuttlefish Industries
The Cuttlefish Engine lets anyone develop great games for iPad, iPhone, Android, WP7, the web, and more!
Advertisement
Or use system() or spawnlp()

------------------
Dance with me......

If this is a Win32 app, ShellExecute() or ShellExecuteEx() would be the prefered ways to launch a BAT or EXE file. The first one is a bit easier to use, IMHO but I think the "microsoft" way to do things nowadays is with the later. Also, WinExec() is *really* easy to use and most compilers nowadays should just be wrapping that name over a call to ShellExecute() to provide overall compatibility. So I think WinExec() is still safe to use. Hope this helps.
I was just wondering if there is a way to run a *.bat file or *.exe file from within a C++ program? I've looked through my reference book, but I couldn't find anything that would do this.

Thanks
Mike

I like to use execl

This topic is closed to new replies.

Advertisement