开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜