How to run the Command Prompt under the SYSTEM account.

Yet another thing that may be useful to the IT people out there – a guide on how to make Command Prompt run under a system account.

 Quick note & disclaimer- this guide assumes that your user account has the rights to create, edit and manually start services. Without these rights, this process guide will fail. As for the disclaimer, this account pretty much provides ‘god rights’ on your computer. What you do with it is entirely up to you, but I’m in no way responsible for you breaking your system.

Moving on…

To get command prompt to run as an admin account, you will need to create a service where the command is to launch command prompt, then launch another command prompt window from there. This is because directly launching command prompt will start it and then close it almost straight away. Launching the second window will give you a window that remains open until you decide to close it.

The command to do this is as follows (and will most likely need to be run via an admin command prompt, depending how your system is setup):

sc create SysCMDPrompt binpath= “cmd /K start” type= own type= interact

Note that all spaces in the command line above are required. Taking and spaces out may result in a failure to launch.

There are two methods to running the service (and thus system CMD).

First Method

– Launch a command window with an account that has permission to launch services

– Enter the command line sc start SysCMDPrompt

Second Method

– Launch the Services control applet with an account that has permission to launch services

– Find the SysCMDPrompt service

– Start the service

Which method you use depends entirely on personal preference.

I’ve bodged together a quick program that creates the service, launches the service and then deletes the service. You can find it here:

http://dl.dropbox.com/u/64814714/System%20CMD%20Launcher.exe

Running under XP is flawless as far as I can tell, however in Windows 7, you will get a message about Interactive Services Detection. Click View the message and you’ll be able to run it – only flaw is that it runs in its own bubble, where you cannot access other programs at the same time (unless run via the command prompt window).

Note in my testing, Windows 7 had to restart explorer most times, upon reverting back to the standard desktop view…

Advertisements
%d bloggers like this: