- How to Run a Program as a Different User (RunAs) in Windows 10?
- How to Run an App as Different User from File Explorer?
- “Run As Different User” Option is Missing in Windows 10
- Using the RunAs Command to Run a Program as Another User from CMD
- How to Use RunAs Without Password Prompt?
- How to Create a Shortcut to Run As Different User?
- How to Run MMC Snap-Ins As a Different User?
- Add “Run As” Option to Start Menu in Windows 10
- How to Run a Program as SYSTEM (LocalSystem) Account in Windows
- Method to run a program under the SYSTEM account:
- How to Run Programs as SYSTEM (LocalSystem account)
- Using PsExec.exe from Windows Sysinternals
- Using Advanced Run from Nirsoft
- Run as SYSTEM via the right-click menu
- Using Process Hacker
- Using NirCmd.exe from NirSoft
- Context menu implementation
- Using RunAsSystem from Uwe Sieber
- Context menu implementation
- Using “NSudo” from M2Team
- NSudo: Command-line support
- Context menu addition
- One small request: If you liked this post, please share this?
- About the author
- 2 thoughts on “How to Run a Program as SYSTEM (LocalSystem) Account in Windows”
How to Run a Program as a Different User (RunAs) in Windows 10?
In all supported Windows versions it is possible to run applications on behalf of another user (Run As) in the current session. This allows you to run a script (.bat, .cmd, .vbs, .ps1), an executable (.exe) or an application installation (.msi, .cab) with another user (usually elevated) privileges.
For example, you can use the RunAs to install apps or run MMC snap-ins under the administrator account in an unprivileged user session. The opportunity to run a program as a different user may be useful when an application is configured under another user (and stores its settings in another user’s profile, which the current user cannot access), but it must be started with the same settings in another user’s session.
In Windows 10 there are several ways to run a program/process on behalf of another user.
How to Run an App as Different User from File Explorer?
The easiest way to run an application on behalf of another user is to use the Windows File Explorer GUI. Just find an application (or a shortcut) you want to start, press the Shift key and right-click on it. Select Run as different user in the context menu.
[alert]Note. If the menu item “Run as different user” is missing, see the next section.
In the next window, specify the name and password of the user under whose account you want to run the application and click OK.
Open the Task Manager and make sure that the application is running under the specified user account.
“Run As Different User” Option is Missing in Windows 10
If there is no Run as different user option in the File Explorer context menu, open the Local Group Policy Editor ( gpedit.msc ) and make sure that the Require trusted path for credential entry policy is disabled (or not configured) in Computer Configuration -> Administrative Templates -> Windows Components -> Credential User Interface.
Using the RunAs Command to Run a Program as Another User from CMD
You can use the Windows built-in cli tool runas.exe to run apps applications as a different user from the command prompt. The runas command also lets you to save the user’s password to the Windows Credential Manager so that you don’t have to enter it every time.
Open the command prompt (or the Run window by pressing Win+R). To start the Notepad.exe under the administrator account, run this command:
runas /user:admin «C:\Windows\notepad.exe»
runas /user:»antony jr» notepad.exe
In the next window, the prompt “Enter the password for admin” appears, where you have to enter the user’s password and press Enter.
Your application should open. In my case, this is cmd.exe. The window title says “running as PCName\username“:
For example, you can open the Control Panel under a different user:
runas /user:admin control
If you need to run a program under a domain user, use the following name format: UserName@DomainName or DomainName\UserName . For example, to open a text file using notepad on behalf of a domain user, use the command:
runas /user:corp\server_admin «C:\Windows\system32\notepad.exe C:\ps\region.txt»
Sometimes you need to run a program as a domain user from a computer that is not joined to the AD domain. In this case, you need to use the following command (It is assumed that the DNS server specified in your computer’s network settings can resolve this domain name):
runas /netonly /user:contoso\bmorgan cmd.exe
If you don’t want to load user profile when starting the program as different user, use the /noprofile parameter. This allows the application to launch much faster, but may cause incorrect operation of programs that store app data in the user’s profile.
How to Use RunAs Without Password Prompt?
You can save the user credentials (with password) that you enter. The /savecred parameter is used for this.
runas /user:admin /savecred “C:\Windows\cmd.exe”
After specifying the password, it will be saved to the Windows Credential Manager.
The next time you run the runas command under the same user with the /savecred key, Windows will automatically use the saved password from the Credential Manager without prompting to enter it again.
To display a list of saved credentials in Credential Manager, use the following command:
rundll32.exe keymgr.dll, KRShowKeyMgr
However, using the /savecred parameter is not safe. Because a user, in which profile it is saved, can use it to run any command with these privileges and even change another user password. Also, it is easy to steal passwords saved in the Credential Manager so it is recommended to prevent a Windows from saving passwords (and never save the password of the privileged administrator accounts).
How to Create a Shortcut to Run As Different User?
You can create a shortcut on your desktop that allows you to run the program as a different user. Just create a new shortcut, and specify the runas command with the necessary parameters in the Location field
When you run such a shortcut, you will be prompted to enter a user password.
If you additionally specify the /savecred parameter in the runas shortcut, then the password will be prompted only once. The password will be saved in Credential Manager and automatically used when you running the shortcut without prompting for a password.
Such shortcuts are quite often used to run programs that require elevated permissions to run. However, there are safer ways to run a program without administrator privileges, or disable the UAC prompt for a specific application.
How to Run MMC Snap-Ins As a Different User?
In some cases, you have to run one of Windows management snap-ins as a different user. For example, you can use the following command to run the Active Directory Users and Computers (ADUC) RSAT snap-in as a different user:
runas.exe /user:DOMAIN\USER «cmd /c start \»\» mmc %SystemRoot%\system32\dsa.msc»
In the same way you can run any other snap-in (if you know its name).
Add “Run As” Option to Start Menu in Windows 10
By default in Windows 10 Start Menu items do not have the “Run As” option. To add the context menu “Run as different user”, enable the “Show Run as different user command on Start” policy in User Configuration -> Administrative Templates ->Start Menu and Taskbar section of the Local Group Policy Editor (gpedit.msc).
Or, if the gpedit.msc is missing, create a new DWORD parameter with the name ShowRunasDifferentuserinStart and value 1 in the registry key HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Explorer. You can use the following PowerShell command to add the reg parameter:
New-ItemProperty -Path «HKCU:\Software\Policies\Microsoft\Windows\CurrentVersion\Explorer» -Name ShowRunasDifferentuserinStart -Value 1 -PropertyType DWORD -Force
Update the Group Policy settings ( gpupdate /force ) and make sure that a new context menu More -> Run as different user has appeared for the programs in the Start menu.
How to Run a Program as SYSTEM (LocalSystem) Account in Windows
Many Windows system files, registry keys, and services are owned by the SYSTEM (a.k.a LocalSystem) account, which has a high privilege level. If you need to modify a registry key owned by the SYSTEM account, there are at least two options.
The first option that comes to your mind is to take ownership of the corresponding registry key, assign yourself Full Control permissions. Once the registry key or the values are updated, revert the permissions and ownership to SYSTEM .
There is, however, an easier option. You can run the program — e.g., the Command Prompt or the Registry Editor under the SYSTEM account directly and update the registry values.
This article lists six different methods using which you can run programs under the SYSTEM or LocalSystem account in any version of Windows, including Windows 10. You can also add a Run as SYSTEM right-click menu option for .exe files.
Method to run a program under the SYSTEM account:
Before proceeding, understand that the terms SYSTEM , LocalSystem , and NT AUTHORITY\SYSTEM are one and the same.
How to Run Programs as SYSTEM (LocalSystem account)
To run a program under the SYSTEM account, use one of the following tools:
Using PsExec.exe from Windows Sysinternals
Use PsExec.exe console tool from Microsoft’s Windows Sysinternals to run a program under the SYSTEM context. Follow these instructions:
- Download PsExec from Microsoft Sysinternals.
- Unzip and extract the tool to a permanent folder — e.g., d:\tools
- Open an elevated or admin Command Prompt window.
- To start the Registry Editor under the SYSTEM account, type the following command, and press ENTER :
The above PsExec command-line starts the Registry Editor under LOCALSYSTEM account so that you can modify protected areas in the registry.
Note: If you launch Command Prompt ( cmd.exe ) using PsExec.exe under the SYSTEM account, it spawns a new Command Prompt window. And, any program you launch from that Command Prompt window would run under the SYSTEM (LocalSystem) account, which is a high privileged account. You must be cautious when running programs under the SYSTEM account so that you don’t accidentally run an undesired program as SYSTEM .
Using Advanced Run from Nirsoft
AdvancedRun is a simple tool for Windows that allows you to run a program with different settings that you choose, including – low or high priority, start directory, main window state (Minimized/Maximized), run the program with different user or permissions, Operating system compatibility settings, and environment variables. You can also save the desired settings into a configuration file and then run the program automatically from the command-line with the desired settings.
Using Advanced Run, you also launch a program under SYSTEM or a different user context.
Type in the program name to run and choose SYSTEM user in the Run As dropdown box, and click Run.
You can also create a desktop shortcut to run a program as SYSTEM. Here is the command-line syntax you use:
/RunAs 4 instructs to start the program under the LocalSystem account. The possible value data for the /RunAs switch are below:
- 1 – Run as current user (elevate)
- 2 – Run as current user (no elevation)
- 3 – Run as Administrator (force elevation)
- 4 – Run as SYSTEM
- 8 – Run as TrustedInstaller
This starts the program under the LocalSystem account, which you can verify in the Task Manager Details tab.
Run as SYSTEM via the right-click menu
To launch a program under the SYSTEM account (with Advanced Run) from the right-click context menu, make a .reg file from the following contents and run the file.
Change the path to AdvancedRun.exe in the .reg file if necessary.
This adds the Run as SYSTEM command to the right-click menu for .exe files and its shortcuts.
Using Process Hacker
Process Hacker is an excellent process manager that looks similar to Sysinternals Process Explorer. This tool has a unique feature that allows you to launch a program under the same account as a running process or service.
- Run Process Hacker as administrator.
- Locate a program or service which is currently running under NT AUTHORITY\SYSTEM .
- Right-click on the process, click Miscellaneous, and click Run as this user…
Now the program (e.g., cmd.exe) would run as SYSTEM ( NT AUTHORITY\SYSTEM )
The above method can also be used to launch any program under TrustedInstaller.
Using NirCmd.exe from NirSoft
NirCmd is a multipurpose command-line tool which we’ve covered in this site before.
NirCmd can start a program elevated as well as launch it under the SYSTEM account.
Use this command-line to start the Registry Editor elevated and under the SYSTEM account:
Context menu implementation
Make a .reg file from the following contents and run the file.
Using RunAsSystem from Uwe Sieber
RunAsSystem (from Uwe Sieber) is a console tool that launches a program under the SYSTEM account or context. It also passes the window style and its process priority to the executed process by default. You can override the window size as well as the child process priority using command-line arguments. Uwe Sieber is the one who developed the famous USB Drive Letter Manager program.
It waits for the started process to end and then passes back its return code (aka errorlevel). However, in a batch file, you have to add start /wait .
Usage:
Examples:
Context menu implementation
Make a .reg file from the following contents and run the file.
The above .reg file adds a Run as SYSTEM command in the right-click menu for .exe files. The .reg file assumes that the file RunAsSystem.exe is placed under the d:\tools folder. If not, alter the path accordingly in the .reg file.
Using “NSudo” from M2Team
NSudo (GitHub) is a similar portable utility like Advanced Run, except that it is not digitally signed. It can launch programs under SYSTEM, Current User, Current Process, or the TrustedInstaller account. We’ve earlier seen how to use NSudo to launch programs as TrustedInstaller.
Select the mode (System) from the dropdown, type in the executable path, and click Run.
Optionally, you can also add a predefined set of programs or commands in the Open: drop-down list box by editing the file named NSudo.json located in the same folder as the executable.
To run a program under the SYSTEM context using NSudo command-line, use this syntax:
See below for the full list of command-line arguments supported by this utility.
NSudo: Command-line support
Context menu addition
- Run NSudo with -Install parameter. It copies NSudo to the Windows directory and adds the context menu.
- To remove the context menu, run NSudo with the -Uninstall parameter. It removes NSudo from the Windows directory and the context menu.
Editor’s Pick: Advanced Run for GUI (and CLI), and PsExec for CLI.
One small request: If you liked this post, please share this?
About the author
Ramesh Srinivasan founded Winhelponline.com back in 2005. He is passionate about Microsoft technologies and he has been a Microsoft Most Valuable Professional (MVP) for 10 consecutive years from 2003 to 2012.
Microsoft → Windows → How to Run a Program as SYSTEM (LocalSystem) Account in Windows
2 thoughts on “How to Run a Program as SYSTEM (LocalSystem) Account in Windows”
This is a really useful article and information. Thank you for that!
I use this feature at the login screen by renaming a few files while Windows is offline. While this is a handy feature for technicians like myself, shouldn’t this be a security issue that Microsoft addresses?