开发者

how to execute batch file from C/C++ w/o console window?

开发者 https://www.devze.com 2023-03-20 07:34 出处:网络
I\'m executing batch file from a C++ program by system(\"star开发者_运维技巧t /B mybatch.bat\") call, where /B is supposed to run batch file w/o console window. But it\'s still visible.

I'm executing batch file from a C++ program by system("star开发者_运维技巧t /B mybatch.bat") call, where /B is supposed to run batch file w/o console window. But it's still visible.

Edit: I resolved the issue by ShellExecute() as was proposed in comments


Why don't you use CreateProcess instead ?


On Windows, if you don't use Windows Runtime, you can try _popen or _wpopen: MSDN.

I used it mainly because _popen creates a pipe so I can easily read output as well.

0

精彩评论

暂无评论...
验证码 换一张
取 消