• Advertisement

Archived

This topic is now archived and is closed to further replies.

launching an .exe

This topic is 5496 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

is there some command to launch and .exe from a c program and sort of wait for it to return? I''ve typed stuff into google and msdn but cant seem to find what I''m looking for.

Share this post


Link to post
Share on other sites
Advertisement
system()


Don''t listen to me. I''ve had too much coffee.

Share this post


Link to post
Share on other sites
Actually it''s:

system("command parameter1 parameter2");

However, CreateProcess() is the recommended way to launch programs from within a Windows program. For regular console applications, system() is ok.

Share this post


Link to post
Share on other sites
For system() use process.h. CreateProcess() is included automatically by windows.h.

If you''re using MSVC, check out the help system. It will tell you what header you need to include for a particular function.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
is that only for use with GUIs, or can you do that with console-c

Share this post


Link to post
Share on other sites
quote:
Original post by The Heretic
Actually system() isin stdlib.h...


It''s in both, but Microsoft recommends process.h.

Share this post


Link to post
Share on other sites
quote:
Original post by Anonymous Poster
is that only for use with GUIs, or can you do that with console-c


Which one?

Both will work in either console or GUI, but CreateProcess is the preferred function for GUI.

Share this post


Link to post
Share on other sites

  • Advertisement