02-04-2016 12:58 PM
If you run system exec and set "run minimized" to false, then you can do things like
cmd /K whoami
which will open the prompt, and the "/K" switch will keep the prompt open after it is complete.
If you set "run minimized" to TRUE, though, it doesn't seem to leave the cmd.exe instance running, even if you have the "cmd /K" setting provided. I think that makes sense--why would you want to leave a non-visible cmd.exe window hanging around?--but I'm just curious what is happening under the hood. Is the system exec actually removing the "/K" switch prior to executing, based on the "run minimized" setting?
I noticed some external code was using "cmd /K" combined with "run minimized", and I want to make sure there aren't any negative repurcussions to that....
02-04-2016 01:53 PM
Try Task Manager/Processes to make sure you don't have a zillion cmd.exe floating around that you thought were gone. 😉
10-17-2017 06:44 PM
Hello,
just found that in Windows 7 & 8, you can have the argument "cmd /K" and run minimized, whereas in Windows 10 you have you match them... i.e. "cmd /K" and "run minimized = FALSE" or "cmd /c" and "run minimized=TRUE", depending on your preference of showing the Windows Command or not...
I discovered this as I am developing an application with CMD prompts and when I was distributing it to Windows 10 users it didnt work 😞 but after some trial and error I found this solution...
Hope this info works for someone 🙂