Take this i try it my self
(1) from inside your program make a batch file containing all
the DOS commands you want and name it "c:\c.bat"
use fopen,fwrite,fclose so simple.
(2) make a new Win32 program and call it "t.exe" and put this code on it.
int PASCAL WinMain(HINSTANCE hCurInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
SetWindowLong(/*your App handle*/, GWL_EXSTYLE, WS_EX_TOOLWINDOW);
(3) Execute this program from inside your main program like this