How to write some command on a batch file through C++ program? -
i need regarding c++ program. batch file named abc.bat
located somewhere in hardisk. know in c++ can use line of code execute abc.bat
file:
system ("file path here\\abc.bat");
i want send commands batch file after executing abc.bat
file c++ program should write commands console , execute them. how can that?
you can opening pipe. in brief:
file *bat = popen("path\\abc.bat", "w"); fprintf(bat, "first command\n"); fprintf(bat, "second command\n"); pclose(bat);
the text write bat
end on standard input of batch file.
Comments
Post a Comment