Command prompt as SYSTEM user (Windows 7)
This was asked on Stack Overflow. The accepted answer uses PsExec (from the Systinternals suite) as Scott suggested.
Another solution involves creating a service that runs under the System account to run the command interpreter. You can do this manually, or use a program that creates the services, runs the prompt, then deletes the service automatically. I just tried it and it worked a treat:
Use PsExec from Microsoft's Systinternals suite. PsExec must be run from an administrative command prompt. Use the -i -s
switches to launch your script/command prompt.
There is a little more hacky approach to this as well, which involves basically subbing cmd.exe in place of Utilman.exe in \Windows\System32 (which would obviously require a backup). You would have to do this outside of the currently running Windows beforehand (e.g. in Linux or via an installation/recovery CD). Here would be an example script to use (via Windows):
cd "%SystemRoot%\System32"
ren Utilman.exe Utilman.exe.bak
robocopy cmd.exe Utilman.exe /copyall
After you do that, boot into regular Windows and hit Windows Key+U, and instead of bringing up a set of utilities to help with accessibility, etc., it brings up a System-level command prompt with all the available tools of your system.
I would be very careful doing this. SYSTEM is the Administrator account but much, much more dangerous as it has a higher level of access.
Generally, your SYSTEM is the account services run under, not an interactive profile. There are ways to do this though.
Reading through this I think we have a good approach:
- Check the name of the account you’ve logged into (Click start. You
will see the name of the account you’ve logged in.) - Launch the command prompt. (Start | Run | cmd | [Enter] )
in command prompt, create a schedule to run cmd.exe.
To create a schedule type the following line and hit enter.
at 10:41 /interactive “cmd.exe”
this will create a schedule to run cmd.exe at 10:41.
(Since you are testing, check the time in your system try and add two or three minutes.)Change this time according to your local time
Hint: you can check if the schedule is placed by typing “at“
and hitting enter after the above step. - Wait for the time you set for the schedule.
cmd.exe would be launched at the specified time. - After cmd.exe is launched by the scheduled time, press [CTRL] + [ALT] + [DEL] and launch task manager.
Select “Process” tab, select explorer.exe in the process list and click “End Process” button.
You will receive a confirmation dialogue. Click “Yes” to end the process. - Close task manager by clicking the close (X) button.
Close the first cmd window (be careful to close the first one not the second one.) - Now you have only the second command prompt window and an empty desktop.
In command prompt type the following line and hit “Enter”
cd .. - In command prompt type the following line and hit “Enter”
explorer.exe
If this is the first time you do it, windows creates the necessary
components for you to access System ( Desktop, start menu,
My document)
when it’s finished you will have a new desktop. - Close command prompt window. Click start and check your username.
It’s changed to System.
Now you are a super-power user. Be careful not to harm your PC and delete or modify system files if you don’t know what you are doing.
The other option would be to run your script as a service.