[FIXED] Launch command line programs behind all open windows from a C++ executable


I am working on C++ program in windows which launches numerous external programs using command lines in quick succession after previous one finishes. Currently a new terminal pops up in front every time I make an external program call. I have tried SYSTEM an POPEN. Is there a way to launch these terminals in the back behind all open windows so that its not annoying to the end user who may be working on other stuff?

One solution is listed here but doesn’t work for me as it still pops up terminal in the foreground.

c++ run system() in background, with spaces in dir path, + output to text file

system("start \"\" cmd abcd.exe");


Unless you really need to use system(), I would recommend using ShellExecuteA, if you set nShowCmd to 0, it doesn’t generate any windows or pop up any consoles.

Answered By – GioByte10

Answer Checked By – Timothy Miller (FixeMe Admin)

Leave a Reply

Your email address will not be published. Required fields are marked *