|
-
April 28th, 2004, 11:58 PM
#1
Running Batch File from C++ Programme
Hi,
I would like to run a batch file from a c++ programme. Is there any command availabe that i can use for the above process.
Thanks in Advance,
Varadha
-
April 29th, 2004, 12:25 AM
#2
Use CreateProcess to launch cmd.exe with the batch file you want to run.
Ex. "cmd.exe /C mystuff.bat"
The /C parameter of cmd.exe tells cmd.exe execute the supplied batch file and terminate when complete.
Execute "cmd /?" at a command prompt to see what else you can do. 
Alternatively, you can call ShellExecute with the operation parameter set to NULL (so the default action is used). This should cause the batch file to be executed by the command processor (cmd.exe).
- Robert
-
April 29th, 2004, 12:58 AM
#3
Batch
I' ve used the "system" command.
system("BatchFile.bat");
It works and never caused a problem.
-
April 29th, 2004, 01:48 AM
#4
This FAQ offers several methods. Just pick the one you prefer....
"A problem well stated is a problem half solved.” - Charles F. Kettering
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|