Advertisement

How to Run Apps as Different User in Windows 11

Being a multi-user OS, Windows 11 allows you to run apps as a different user. It means that if you have more than one user account, you can run some app under different credentials. This can be useful when you quickly need to apply some restrictions to an app or prevent it from accessing your personal data.

Advertisеment

Run as different user is a built in feature of Windows 11, so you don't have to install extra software. Besides launching regular apps (.exe), you can use it with batch files (.bat, .cmd) and installer packages (.msc, or .msi).

This way, the app, script, or installer will run with the same right, restrictions and permissions as the target user. They won't use the user account data to which you are  currently signed in.

The latter allows you to have multiple instances of the same app running under different credentials on the desktop.

There are four ways to run an app as different user in Windows 11. For that, you can use options available in File Explorer, the taskbar, Start menu, and Command Prompt.

Run as Different User in Windows 11

To run an app as a different user in Windows 11, do the following.

  1. Open File Explorer (Win + E) and go to the folder that contains the app exe file.
  2. Press and hold the Shift key on the keyboard
  3. Right-click the executable file to open the context menu. You can now release the Shift key.
  4. Click on "Show more options" to open the extended context menu.Right-click the executable file
  5. Click on the Run as different user in the context menu.
  6. Windows 11 Run As Different User
  7. Fill in the the user name and password for the user you want to run as.Fill in credentials

You are done. The app will start under the provided credentials of the different user.

Again, there a few more methods to launch an executable file, script or installer under different credentials.

Run as different user from the taskbar context menu

  1. Right-click the app icon in the taskbar. It can a pinned or running app.
  2. Press and hold the Shift key.
  3. While holding Shift, right-click the app name in the context menu to see extra menu items.Shift+right-click the app in taskbar
  4. Release the Shift key and click Run as different user.
  5. Finally, provide the user account data to run a new instance of the app from.Run as different users from taskbar

Note: This method doesn't work for File Explorer, either pinned or running. The Run as command isn't available for its taskbar icon.

Finally, Windows 11 includes the console app "runas" that allows you to launch apps using different credentials. Here's how to use it.

Run as different user in Windows 11 from Command Prompt

  1. Right-click the Start button in the taskbar and select Windows Terminal from the context menu.Open Windows Terminal
  2. Select PowerShell or Command Prompt if Terminal opens to some other profile.
  3. Type the following command and press Enter. runas /user:"username" "Full path to the exe file"​.
  4. Substitute username with the actual user account name you want to run as. If it is a domain account, use the Domain name\User name format.The Runas console command
  5. Also, if you want to save the entered credentials for future use, run the command as runas /user:"username" /savecred "Full path to the exe file"​. Windows will save the password to Credential Manager and won't ask it next time.Runas savecred

In addition to the above reviewed methods, you can also add the "Run as different user" command to the Start menu. It will appear in the right-click menu for shortcuts in the "All apps" view.

For that purpose, Windows 11 includes a Group Policy. You can activate it with either a Registry tweak or in gpedit.msc. The first option works in all editions of Windows 11. The latter is only available in Windows 10 Pro and above.

Enable Run as for the Start menu shortcuts

To enable the Run as different user option for the Start menu in Windows 11, do the following.

  1. Download the ZIP archive using this link.
  2. Extract the REG files from it to any folder.reg files to enable Run as for the Start menu shortcuts
  3. Double-click the file Add_Run_as_different_user_for_Start_menu.reg​ to enable the option for the Start menu shortcuts.
  4. Confirm the UAC prompt by clicking on the Yes button.
  5. Sign out from Windows 11 or simply restart it to apply the change.
  6. The Start menu now shows the Run as different user command.

You are done. The undo file is Remove_Run_as_different_user_for_Start_menu.reg; use it to restore the defaults.

If you are running Windows 10 Pro or above, you can use the Local Group Policy Editor instead.

The Group Policy method

  1. Press Win + R and type gpedit.msc into the Run box, then hit Enter.open gpedit
  2. Navigate to User Configuration > Administrative Templates > Start Menu and Taskbar​.
  3. Find the Show "Run as different user" command on Start policy on the right and double-click it.
  4. Select Enabled to add the Run as different user" command to Start menu shortcut context menu. Click apply and OK.Add Run as to Start with Group Policy
  5. Setting it to Not configured at any moment later will hide the command (defaults).

You are done. Now the command is available for the Start menu shortcuts. Here's how to use it.

Run as different user from the Start menu

  1. Enable the Run as different user command for
  2. Open the Start menu.
  3. Click on the All apps button.Click the All apps button
  4. Locate the app shortcut for your app and right-click it.
  5. Select More > Run as different user.Run As Different from the Start menu
  6. Fill in the user name and password text boxes and hit the Enter key.

Done!

Finally, if you often use the Run as different user context menu, you may find annoying to hold the Shift key every time you click the Show more options item. To save your time, you can make it always visible in the extended context menu under "Show more options". Note: You cannot add to the default "compact" context menu. Do be confused between the two menu types.

Always show Run as different user in the context menu

  1. Press Win + R to open the Run dialog; type regedit and hit Enter to open the Registry editor.
  2. In the left pane, go to the HKEY_CLASSES_ROOT\exefile\shell\runasuser key.
  3. On the right, delete the Extended empty string value.Always show Run as different user
  4. Now, delete the same Extended string value under the following keys:
    • HKEY_CLASSES_ROOT\cmdfile\shell\runasuser
    • HKEY_CLASSES_ROOT\batfile\shell\runasuser
    • HKEY_CLASSES_ROOT\mscfile\shell\runasuser
    • HKEY_CLASSES_ROOT\Msi.Package\shell\runasuser
  5. The Run as different user command will now always be visible in the "Show more options" menu variant.

To undo this change, simple re-create the removed "Extended" value under the respective keys.

To automate this process, you can use the following ready-to-use Registry files.

Download Registry Files

The Always_show_Run_as_different_user.reg file makes the command appear directly without holding the Shift key for the "Show more options" item. The other included REG file will undo the change.

However, sometimes you may want to achieve the opposite effect and hide the "Run as different user" command for all users. For that purpose, you need to apply a little bit different tweak. Let's review it for the sake of completeness.

Remove the Run as different user context menu for all users

  1. Open the Registry editor (regedit.exe).
  2. Navigate to the following key HKEY_CLASSES_ROOT\cmdfile\shell\runasuser.
  3. Right-click the runasuser key on the left and select New > String value from the menu.
  4. Name the new value as ProgrammaticAccessOnly and leave its value data empty.Crate the ProgrammaticAccessOnly value
  5. Repeat the steps 2-4 under the following keys
    1. HKEY_CLASSES_ROOT\cmdfile\shell\runasuser
    2. HKEY_CLASSES_ROOT\batfile\shell\runasuser
    3. HKEY_CLASSES_ROOT\mscfile\shell\runasuser
    4. HKEY_CLASSES_ROOT\Msi.Package\shell\runasuser
  6. The "Run as different user" entry is now removed for all users.Remove Run As Different User from context menu

You are done. The ProgrammaticAccessOnly value instructs File Explorer to hide the context menu item from the user. But it doesn't break functionality of apps or Windows. The hidden command remains accessible for apps if some of them need to access it.

To add the context menu item back, simply remove the ProgrammaticAccessOnly value you have created.

To save your time, I have prepared a couple of REG files for this case. Click here to download them:

Download REG files

The file Remove_Run_as_different_user_from_context_menu.reg​ will hide the menu item. The other file, Add_Run_as_different_user_from_context_menu.reg​, will restore the command in the right-click menu.

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

Author: Sergey Tkachenko

Sergey Tkachenko is a software developer who started Winaero back in 2011. On this blog, Sergey is writing about everything connected to Microsoft, Windows and popular software. Follow him on Telegram, Twitter, and YouTube.

Leave a Reply

Your email address will not be published.

css.php
Using Telegram? Subscribe to the blog channel!
Hello. Add your message here.