Click here to Skip to main content
15,881,248 members
Please Sign up or sign in to vote.
2.00/5 (2 votes)
See more:
I'm running a batch file from C++ code. When I run it from system. It runs. When I use ShellExecute() it doesn't! What am I doing wrong? Thank you.
C++
system("C:\\Batch\\666.bat"); Works

HINSTANCE hInst = ShellExecute(0,"open","c:\\batch\\666.bat","",0,0); No Work
Posted

1 solution

hello Member 7766180:

You program is already running,you just set hide runs,revised code :

C++
HINSTANCE hInst = ShellExecute(0,"open","c:\\batch\\666.bat","",0,SW_SHOW );
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900