Since its very first version, Windows NT has allowed the user to launch apps with different permissions and credentials than the current user. Using it, you can start a batch file, an executable file or even an app installer as another user. Let's see how it can be done.
Advertisеment
There are two ways to run a process as a different user in Windows 10. This can be done using the context menu in File Explorer or with a special console command.
Having this ability is very useful in a wide range of situations. For example, if you are working under a limited user account, but need to install an app or open an MMC snap-in like Disk Management, you can run the required app under another user account which has administrator privileges. It is especially useful when an app doesn't ask for administrative credentials and just refuses to start. Another good example is when you have configured an app to work under a different user profile, so other apps and users won't have access to its configuration data. This improves the security for apps which deal with very sensitive data.
To run an app as a different user in Windows 10, do the following.
- Open File Explorer and go to the folder which contains the required app.
- Press and hold the Shift key and right-click on the file.
- In the context menu, select Run as different user.
- Enter the new credentials and click OK to run the app.
You are done.
Tip: You can make the 'Run as' command always visible in the context menu and in the Start menu. See the following articles:
- Make Run as Always Visible in Context Menu in Windows 10
- Add Run as different user to Start Menu in Windows 10
Also, you can use Winaero Tweaker to save your time. It allows adding the Run as a different user command to both the Start menu and the context menu.
You can download the app here: Download Winaero Tweaker.
Now, let's see how to run apps as a different user from the command prompt. This will allow you to run the app from the command line or with a shortcut. Also, using this method, it is possible to save the another user's credentials, so you won't have to enter them every time when starting an app using the shortcut to start the app as that user. For command line use, Windows 10 includes the runas console tool.
Run as different user using the command prompt
- Open a command prompt.
- Type the following command:
runas /user:"USERNAME" "Full path of file"
Replace the USERNAME portion with the correct user name and provide the full path to the executable file, msc file, or batch file. It will be started under a different user account.
- To save the credentials for the provided user account, add the /savecred option to the command line, as follows:
runas /user:"USERNAME" /savecred "Full path of file"
The next time you run an app under the same credentials, you won't be asked for the user account password.
The provided credentials will be saved in Credential Manager in the Control Panel. See the following screenshot.
Tip: Using the runas console tool, it is easy to create a shortcut to launch apps under a different user in Windows 10. Use the last command as your shortcut target.
runas /user:"USERNAME" /savecred "Full path of file"
Run it once from the command prompt to save the password, so that the shortcut directly starts apps without extra prompts subsequently.
That's it.
Support us
Winaero greatly relies on your support. You can help the site keep bringing you interesting and useful content and software by using these options:
If you like this article, please share it using the buttons below. It won't take a lot from you, but it will help us grow. Thanks for your support!
Advertisеment
Is there any way to open a specific website using this command?
create a batch file with
@echo off
start URL
can i user Active Directory in Win10? Thx.