I know there is a piece of code that allows you to run a dos program, but I can't rember what it is. I want to run a program that will tell a dos bat file to run. can anyone help me???
I know there is a piece of code that allows you to run a dos program, but I can't rember what it is. I want to run a program that will tell a dos bat file to run. can anyone help me???
one way I can think of is:
Code:system("path\\to\\bat");
this is the code i usually use to run an exe (if i'm using a system call):...or were you saying that you wanted to run something like command.com and then pass a batch file to it?Code:system("start \"[TITLE]\" [PATH] /B");
edit: don't forget about the escape sequences, as pointed out by the above post
Join is in our Unofficial Cprog IRC channel
Server: irc.phoenixradio.org
Channel: #Tech
Team Cprog Folding@Home: Team #43476
Download it Here
Detailed Stats Here
More Detailed Stats
52 Members so far, are YOU a member?
Current team score: 1223226 (ranked 374 of 45152)
The CBoard team is doing better than 99.16% of the other teams
Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)
Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT
and how do I initiate a your system command. What lib is it in??? I am a student, and am just learning. My teacher couldn't remember the command. I'd appreciate assistance. I have a program that is outputting data to a text file, and then I have a bat file that tells the computer to print the text file to the local printer. How can I tell the program to run the bat file.
Last edited by danielp; 10-29-2003 at 09:12 PM.
Here.
The header file is stdlib
to run a bat file in your program add this line somewhere in your code:
replace "c:\\mybatfile.bat" with the path to your bat file, and don't forget to use \\ instead of just one \Code:system("c:\\mybatfile.bat");
hth