How to 'Run as different user' in Windows 10
Run as different user allows a user to run .bat, .cmd, .exe, .msc, and .msi files with different permissions than the user's current logon provides.
Run as different user will only affect the current instance of the running .bat, .cmd, .exe, .msc, or .msi file. You can open multiple instances of the file with each instance running as a different user.
This tutorial will show you how to use Run as different user to run .bat, .cmd, .exe, .msc, and .msi files with different permissions than your account in Windows 10.
If the user you use with "Run as different user" doesn't have the appropriate permissions to access the file, then you will get an access is denied type error message like below.
Contents
- Option One: To "Run as different user" in Context Menu
- Option Two: To "Run as different user" in Command Prompt
1 Press and hold the Shift key, right click or press and hold on a .bat, .cmd, .exe, .msc, or .msi file that you want to run as a different user, click/tap on Run as different user, and release the Shift key. (see screenshot below)
2 Enter the credentials of the user you want to run as, and click/tap on OK.
If this is for a domain user, then you would enter their user name using one of the parameters below.
UserName@DomainName
OR
DomainName\UserName
For more on the usage of the runas command, see: Runas - Microsoft Docs
1 Open a command prompt.
2 Type the command below you want to use into the command prompt, and press Enter. (see screenshots below step 3)
runas /user:"<username>" "Full path of file"
OR
(To save credentials and use saved credentials of user)
runas /user:"<username>" /savecred "Full path of file"
Substitute <username> in the commands above with the actual user name of the account you want to run the file as. If this is for a domain user, then you would enter their user name using one of these parameters: UserName@DomainName or DomainName\UserName
Substitute Full path of file in the commands above with the actual full path of the .bat, .cmd, .exe, .msc, or .msi file you want to run as the user.
3 Type the password of the user, and press Enter. (see screenshots below)
You will not see the text of the password as you enter it.
If you had previously used the command from step 2 with the /savecred switch for the same user, then you will not be prompted to enter the user's password since it was saved in Credential Manager last time.
4 If you used the command from step 2 with the /savecred switch, then the password you entered in step 3 (if prompted) for the user will be saved in Credential Manager. (see screenshot below)
That's it,
Shawn Brink
Related Tutorials
- How to Run an App as Administrator in Windows 10
- How to Add or Remove 'Run as different user' Context Menu in Windows 10
- How to Add or Remove 'Run as different user' Context Menu on Start in Windows 10
- How to See What User a Process is Running As in Windows 10