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!

Executing other programs...

Status
Not open for further replies.

SoulSkorpion

Technical User
Sep 1, 2002
7
AU
How can I execute another program (that is, an already existing, compiled .exe) using c++ code? I want to write a program which only allows you to enter another program if you enter the right password, but I'm at a loss how to actually start the other program once the right password has been entered.

Thanks

SoulSkorpion
 
hi,

try by function

WORD wReturn = WinExec( csCmd, fuCmdShow ) ;

bye.
 
you can also use:
#include <windows.h>
.....
...
ShellExecute (NULL,&quot;open&quot;,&quot;path_to_file&quot;,NULL,NULL,
SW_SHOWNORMAL);

replace path_to_file with your file path.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top