How to Run a Program as a Different User (RunAs) in Windows 10?

In all supported Windows variations it’s attainable to run functions on behalf of one other consumer (Run As) in the present session. This permits you to run a script (.bat, .cmd, .vbs, .ps1), an executable (.exe) or an utility set up (.msi, .cab) with one other consumer (often elevated) privileges.

For instance, you should use the RunAs to set up apps or run MMC snap-ins below the administrator account in an unprivileged consumer session. The alternative to run a program as a totally different consumer could also be helpful when an utility is configured below one other consumer (and shops its settings in one other consumer’s profile, which the present consumer can’t entry), nevertheless it have to be began with the identical settings in one other consumer’s session.

[/alert]

In Windows 10 there are a number of methods to run a program/course of on behalf of one other consumer.

The Secondary Log-on service (seclogon) is liable for the flexibility to run packages as totally different consumer in Windows. If this service is stopped, the entire described RunAs strategies received’t work. You can examine that the service is began with the next command:

Get-Service seclogon

How to Run an App as Different User from File Explorer?

The easiest method to run an utility on behalf of one other consumer is to use the Windows File Explorer GUI. Just discover an utility (or a shortcut) you need to begin, press the Shift key and right-click on it. Select Run as totally different consumer in the context menu.

[alert]Note. If the menu merchandise “Run as totally different consumer” is lacking, see the following part.

Run as different user option

In the following window, specify the title and password of the consumer below whose account you need to run the appliance and click on OK.

Note. If you want to specify a area consumer, one of many following codecs of the title is used: [email protected] or AreaNameUserName.

windiows security dialog - enter different user's password

Important. Running this system on behalf of various consumer is feasible if the account has a password. Using RunAs for a consumer with an empty password received’t work.

Open the Task Manager and ensure that the appliance is working below the desired consumer account.

taskmanager the application is running under different user

“Run As Different User” Option is Missing in Windows 10

If there isn’t any Run as totally different consumer possibility in the File Explorer context menu, open the Local Group Policy Editor (gpedit.msc) and ensure that the Require trusted path for credential entry coverage is disabled (or not configured) in Computer Configuration -> Administrative Templates -> Windows Components -> Credential User Interface.

GPO: Require trusted path for credential entry

Using the RunAs Command to Run a Program as Another User from CMD

You can use the Windows built-in cli instrument runas.exe to run apps functions as a totally different consumer from the command immediate. The runas command additionally permits you to to save the consumer’s password to the Windows Credential Manager so that you just don’t have to enter it each time.

Open the command immediate (or the Run window by urgent Win+R). To begin the Notepad.exe below the administrator account, run this command:

runas /consumer:admin "C:Windowsnotepad.exe"

Tip. If the username accommodates areas, put quotes round it:

runas /consumer:"antony jr" notepad.exe

using runas in command prompt

In the following window, the immediate “Enter the password for admin” seems, the place you may have to enter the consumer’s password and press Enter.

Enter the password for admin

Your utility ought to open. In my case, that is cmd.exe. The window title says “working as PCNameusername“:

For instance, you’ll be able to open the Control Panel below a totally different consumer:

runas /consumer:admin management

If you want to run a program below a area consumer, use the next title format: [email protected] or AreaNameUserName. For instance, to open a textual content file utilizing notepad on behalf of a area consumer, use the command:

runas /consumer:corpserver_admin "C:Windowssystem32notepad.exe C:psregion.txt"

Attempting to start an app as different user

Enter the password for corpserver_admin:
Attempting to begin C:Windowssystem32notepad.exe C:psregion.txt as consumer "corpserver_admin " ...

Sometimes you want to run a program as a area consumer from a pc that’s not joined to the AD area. In this case, you want to use the next command (It is assumed that the DNS server specified in your pc’s can resolve this area title):

runas /netonly /consumer:contosobmorgan cmd.exe

If you don’t need to load consumer profile when beginning this system as totally different consumer, use the /noprofile parameter. This permits the appliance to launch a lot quicker, however could trigger incorrect operation of packages that retailer app knowledge in the consumer’s profile.

How to Use RunAs Without Password Prompt?

You can save the consumer credentials (with password) that you just enter. The /savecred parameter is used for this.

runas /consumer:admin /savecred “C:Windowscmd.exe”

After specifying the password, it will likely be saved to the Windows Credential Manager.

The subsequent time you run the runas command below the identical consumer with the /savecred key, Windows will mechanically use the saved password from the Credential Manager with out prompting to enter it once more.

To show a checklist of saved credentials in Credential Manager, use the next command:

rundll32.exe keymgr.dll, KRShowKeyMgr

windows runas with savecred option

However, utilizing the /savecred parameter is just not protected. Because a consumer, in which profile it’s saved, can use it to run any command with these privileges and even change one other consumer password. Also, it’s straightforward to steal passwords saved in the Credential Manager so it’s endorsed to (and by no means save the password of ).

Note. In addition, /savecred doesn’t work in Windows Home version.

How to Create a Shortcut to Run As Different User?

You can in your desktop that permits you to run this system as a totally different consumer. Just create a new shortcut, and specify the runas command with the mandatory parameters in the Location subject

shortcut with runas command

When you run such a shortcut, you may be prompted to enter a consumer password.

If you moreover specify the /savecred parameter in the runas shortcut, then the password can be prompted solely as soon as. The password can be saved in Credential Manager and mechanically used if you working the shortcut with out prompting for a password.

Such shortcuts are very often used to run packages that require elevated permissions to run. However, there are safer methods to, or

How to Run MMC Snap-Ins As a Different User?

In some circumstances, you may have to run one in every of Windows administration snap-ins as a totally different consumer. For instance, you should use the next command to run the Active Directory Users and Computers (ADUC) snap-in as a totally different consumer:

runas.exe /consumer:DOMAINUSER "cmd /c begin "" mmc %SystemRootpercentsystem32dsa.msc"

In the identical manner you’ll be able to run every other snap-in (if you realize its title).

Add “Run As” Option to Start Menu in Windows 10

By default in Windows 10 Start Menu gadgets shouldn’t have the “Run As” possibility. To add the context menu “Run as totally different consumer”, allow the “Show Run as totally different consumer command on Start” coverage in User Configuration -> Administrative Templates ->Start Menu and Taskbar part of the Local Group Policy Editor (gpedit.msc).

Show “Run as different user” command on Start

Or, if , create a new DWORD parameter with the title ShowRunasDifferentuserinStart and worth 1 in the registry key HKEY_CURRENT_USERSoftwarePoliciesMicrosoftWindowsExplorer. You can use the next :

New-ItemProperty -Path "HKCU:SoftwarePoliciesMicrosoftWindowsCurrentVersionExplorer" -Name ShowRunasDifferentuserinStart -Value 1 -PropertyType DWORD -Force

ShowRunasDifferentuserinStart registry

Update the Group Policy settings (gpupdate /pressure) and ensure that a new context menu More -> Run as totally different consumer has appeared for the packages in the Start menu.

Run as different user in start menu

Check Also

How to Use and Repair Windows Recovery Environment (WinRE) on Windows 10?

Windows Recovery Environment (WinRE) is the minimal OS based mostly on Windows Preinstallation Environment (WinPE) …

Leave a Reply

Your email address will not be published. Required fields are marked *