0

i'm having a problem in executing a batch file from my c++ code
i've included all the necesary headers like dos.h,process.h,stdlib.h

code:
system(c:\new\ram.bat);

there is no error in the program but the batch file does not get executed.....


please help ................

6
Contributors
8
Replies
9
Views
7 Years
Discussion Span
Last Post by thomas_naveen
0

You need to escape the backslashes with another backslash (just like using a backslash to escape double quotes and the like): system("c:\\new\\ram.bat");

0

You need to send system() a string. Put c:\\new\\ram.bat in double-quotes.

Edited by Fbody: n/a

0

system("c:\\new\\ram.bat");
it still doesnt worked..........
everything is working fine and there is no error in program .but the batch file doesnt executes..............

Edited by mucoool: n/a

0

Then
1) the batch file is not in the directory specified
2) the system call is not being executed
3) the batch file is being executed and give no feedback
4) the program is not working fine

Maybe more details are necessary.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.