14
6
I'm trying to launch cmd.exe in session 0. So far I've done the following from an elevated command prompt:
sc config UI0Detect start= auto
net start UI0Detect
And the response indicates that the service was started correctly. It is at this point that I assumed if I switched to session 0, cmd.exe would be running.
I switch to session 0 using the following command:
rundll32 winsta.dll,WinStationSwitchToServicesSession
This successfully switches me to session 0, but the only window that's available is the one that has the option to return to session 1.
How do I get cmd.exe to launch in session 0?
Why would you want to do this? UI0Detect allows old services to pop up a message box, not starting new GUI Apps. cmd.exe has a GUI – Peter Hahndorf – 2012-05-21T04:56:08.073
6@PeterHahndorf I understand that it's fun to deflect answering questions by saying "let's take a step back and see if this is what we really need to do because this sounds like a bad idea", and it's a relatively nice way to condescend fellow developers. But since this is for a debugging scenario and meant to be a quick fix (and alternative to using some 3rd party app like AlwaysUp), I don't really see how asking "why" is a helpful response. Thanks anyway. – omghai2u – 2012-05-21T05:12:30.627
I think Peter has a point. The question you should have wrote is "This is what I'm trying to do." A quick fix will only involve future pain. I can't count how many times I've heard "quick fix" only to still see the "quick fix" in production three years later. . . needing another "quick fix". I'm assuming you are typing to run a batch script of some sort? – surfasb – 2012-05-21T08:54:33.843
1@surfasb The question you suggested is essentially the question I wrote: "I'm trying to launch cmd.exe in session 0." Please keep answers focused on that question. Thanks. And there's no chance this will make its way into production, or for it to involve future pain. The way I do it for production is already set but I can't use it for debugging. The way I currently do it for debugging is cumbersome and involves using a 3rd party app. – omghai2u – 2012-05-21T19:20:56.823