简体   繁体   中英

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

I'm executing batch file from a C++ program by system("start /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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM