Home > Mobile >  Launch command line programs behind all open windows from a C executable
Launch command line programs behind all open windows from a C executable

Time:08-04

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");

CodePudding user response:

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.

  • Related