This article lists both native and non-native methods you can adapt to run an app or a file as another user on a Windows computer. These methods can also be used to run an app or program as an administrator, or for when you want to use the settings/configurations for an app set for another account. You can run scripts and programs as a user account that has elevated privileges from an underprivileged user account. Of course, it would require the necessary user account credentials. Before we discuss the many methods to run an app, program, or file as another user, there are a few things you must consider.
Prerequisites to Run App as Different User in Windows
Whether you want to run a file as a local user or a domain user; all can be done using this guide.
Prerequisites to Run App as Different User in Windows How to Run App/Program as Different User In Windows Run as Different User from Context Menu Run as Different User from Command Prompt/Run Command Run as Different User from PowerShell Run as Different User using Shortcut Run as Different User using RunAsTool Run as Different User from Start Menu Fix “Run as Different User” Option Missing in Context Menu Closing Thoughts
However, before you do, you must enable the Secondary Logon service, also referred to as “RunAs.” This Windows service is responsible for allowing different apps and files to be run as different user. If this service is not running or is problematic, then you won’t be able to run anything as a different user. To check the status of the Secondary Logon service, run the following cmdlet in PowerShell: If you find that the service is not running, then run the following command to enable it: The Secondary Logon service is set to start manually when called upon. To allow it to run automatically, use these steps: Now, the Secondary Logon service will start automatically in the background every time you are logged into your account. Apart from the Secondary Logon service, you must also ensure that the account you want to use to run a file as a different user must have a password. You cannot run an app/program as a different user that has no password configured. After having ensured that both of these conditions are met, it is now time to move on to running a file/app as a different user.
How to Run App/Program as Different User In Windows
Run as Different User from Context Menu
This method can be applied to any file, may it be a .exe, .bat, .ps1, or any other, to run it as a different user. However, it can not be implemented on Universal Windows Platform (UWP) applications. For that, you must use the PowerShell method shared below. The easiest method to run a file as a different user is through the context menu by holding the Shift key while right-clicking the file. The file will now run from the other user account. You can confirm this through the Details tab in the Task Manager. Note: If the “Run as different user” option is missing from the context menu, it might be disabled. To enable it, refer to the last section of this post. To run the file as a local user from a machine connected to a domain, use the syntax “.\Username”.
Run as Different User from Command Prompt/Run Command
You can also use the command line to run a file as a different user. This method can be used in both the Command Prompt and the Run Command box. To learn how to run a file as a different user using PowerShell, refer to the next section below. You can run a file as a different user using the “RunAs” command line tool. Here is how: You will now see that the file will run from the other user account. To run the file from an Active Directory user account, use the syntax “DomainName\Username” in place of [UserName]. Note: You will see no text in the command line while entering the password.
Run as Different User from PowerShell
To run a file as a different user using PowerShell, the syntax of the command is a little different. However, it can be done using a single cmdlet. You can also use this method to run the UWP application as another user. But first, let us see how to run any file using PowerShell: The file will now be executed from the other user account. Replace [PathToFile] with the complete path to the file to run. To run a UWP application as a different user, you must first have the name of the app. Use these steps to run a Windows UWP app as a different user: The UWP app will now run as a different specified user.
Run as Different User using Shortcut
If you occasionally have to run a specific file from a specific user account, it would be convenient to create a custom shortcut. Simply running the shortcut will run the file from a specified user account every time. Use these steps to create a shortcut and run a file from a different user: The shortcut will now be created. All you must do now is double-click the shortcut to run the specified file with the specified user. However, you will still need to provide the password for the configured user account every time you run the shortcut. The Create Shortcut wizard will now open. The syntax of the location will be something like this:
Run as Different User using RunAsTool
The RunAsTool is a portable app in which you can save user credentials and then the app can automatically run programs and files listed in the app as the specific user all the time, just like the shortcut method we discussed above. This tool is especially useful for system administrators who want to give administrative rights to standard users only for specific programs and applications. Use these steps to use the RunAsTool to run apps, programs, and files as different users: Now you can double-click any application within RunAsTool to run directly from the specified user account. Note that the “administrative” account for the RunAsTool is now the account for which you initially entered the credentials in Step 4 above.
Run as Different User from Start Menu
The methods to run an app/program as a different user we have discussed so far have no effect on the items visible inside the Start menu. If you want to have the “Run as different user” option in the context menu of the Start menu, then you must follow these steps: You can now check that the “Run as different user” option is now available in the Start menu. You may now select this option and provide the credentials for the user account you want to run the selected app as. That said, note that the UWP apps still won’t have the option to “Run as different user” in their context menu, even inside the Start menu. For that, you must use the PowerShell method shared above.
Fix “Run as Different User” Option Missing in Context Menu
Till now we have discussed different methods to run an app, program, or file as a different user. Some of these methods involved selecting the “Run as different user” from the context menu. However, it may be possible that the option has been disabled deliberately. You can thus enable the “Run as different user” using the following steps. Once it reboots, you should have the “Run as different user” option in the context menu for both File Explorer as well as the Start menu (if the option has been enabled as given above). You can also use our top selection of disk imaging and backup software so you never lose your data or operating system again.
Closing Thoughts
Having the ability to run a program, script, file, or UWP app as a different user can be time-saving and allows you to run something with either elevated or restricted privileges. In this article, you will find all the possible methods to run an app as a different user while remaining inside your current user account. This approach can be taken when you want to run something with elevated privileges, or when you want to run something with even lower rights, such as an app that might be malicious. Additionally, you can also run something as a different user when you want to use the settings specific to the other user account. For example, you can run Microsoft Teams as another user so that you are automatically logged into another account (which was previously logged into the other user account).