Re: How To Use wxShell or wxExecute Without Opening A Console Window
- Posted by ghaberek (admin) in April
- 237 views
So, it seems that was a bug in my code, and that using a commandline of "start" without cmd.exe shouldn't have even worked, so it was always calling wx_shell(), which I'm guessing opens a commandline console and runs the given prompt.
Yes, "start" command works in wx_shell() because it's telling cmd.exe to run the command, and cmd.exe supports the "start" command.
My assumption above was the same thing, just by launching cmd.exe with wx_execute() and using the /C flag to run the same "start" command.
...which works perfectly for Windows 11. I'm just going to cross my fingers that it works across all prior versions of Windows. (Yes, there will be tests later.)
It ought to. According to the documentation for ShellExecute it's been supported since XP, though I suspect it goes back even further.
Thank you, @ghaberek! I owe you coffee AND lunch.
One day I will hold you to that, sir.
-Greg