Instead of closing the console window you could compile without the /CONSOLE flag and then use AttachConsole in the case of the non-gui application.
We are actually using a two-application solution which is a little different than a launcher script. This solution is taken from Microsoft itself. Visual Studio comes as a devenv.exe and a devenv.com. The .exe is the GUI application and the .com is the command line application. On the command line (when using the application name without the file ending) it will start the .com application. In our own application we added command line parameters to have each call the other one (using QProcess) to switch between GUI/non-GUI.