LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

"cmd /K" and "run minimized"

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....

0 Kudos
Message 1 of 3
(4,998 Views)

Try Task Manager/Processes to make sure you don't have a zillion cmd.exe floating around that you thought were gone.  😉

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 2 of 3
(4,985 Views)

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 🙂

Message 3 of 3
(4,267 Views)