How can I load the batch file console to my C console?
I know in batch The command is Showme.bat /B
and it'll load the console into whatever console you called that file from.
What would that be in C
?
ShellExecute(NULL,"open","Showme.bat",NULL,NULL,SW_SHOW);
Also, doing that... How could I also add additional arguments s开发者_Python百科uch as
>>LogTheConsoleTo-a-File.log
Is that possible?
Use the POSIX function "popen". With MSVC/MinGW you can use "_popen" instead. This give you the needed control.
I figured it out but I still cannot keep writing to the same file.
Here's what I did: ShellExecute(NULL,"open","Showme.bat",">>consoleLog.log",NULL,SW_SHOW
);
精彩评论