Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to call an exe file within a console VC++ app?

Status
Not open for further replies.

khilscher

Programmer
May 28, 2002
8
CA
I am trying to wrap a command-line exe program (single executable file app) into a console-based app with VC++ 6. I am not using MFC. Within my console application I want to call the exe file and pass some params to it. What function or method can I call to do this?

TIA,

Kevin
 
#include <process.h>

// call the program
// command must be what you type at the dos-prompt
// in order to start the program

char command[] = &quot;C:\\dir\\prog.exe param1 param2 param3&quot;;

void main ( )
{
system ( command );
}


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top