Run as different user in Windows 10  

    Run as different user in Windows 10

    Run as different user in Windows 10

    How to 'Run as different user' in Windows 10
    Published by Category: User Accounts
    12 Dec 2020
    Designer Media Ltd


    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.
    Run as different user in Windows 10-access_denied.png



    Contents

    • Option One: To "Run as different user" in Context Menu
    • Option Two: To "Run as different user" in Command Prompt






    OPTION ONE

    To "Run as different user" in Context Menu


    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)

    Run as different user in Windows 10-run_as_different_user-1.png

    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

    Run as different user in Windows 10-run_as_different_user-2.png






    OPTION TWO

    To "Run as different user" in Command Prompt


    For more on the usage of the runas command, see: Runas - Microsoft Docs

    Run as different user in Windows 10-runas_usage.png


    1 Open a command prompt.

    2 Typethe command you want to use below 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.

    Run as different user in Windows 10-runas_command-1.png
    Run as different user in Windows 10-runas_command-2.png

    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)

    Run as different user in Windows 10-credential_manager.png


    That's it,
    Shawn



  1. D4ni3l's Avatar
    Posts : 310
    Microsoft Windows 10 x64
       #1

    this trick make life easier to run Windows 10 as a "standard user" most of the time (for safety reason)
    but have quick access to administrator rights without entering the password every time

    I have stored my new admin "runas" shortcuts in "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\myApps" to get access through the start menu

    thanks Brink
      My Computer

  2. Brink's Avatar
    Posts : 59,147
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #2

    I'm glad it could help Daniel. :)
      My Computers


  3. Posts : 9
    Windows 10
       #3

    Hi Brink,
    I am able to open notepad.exe but when I try explorer.exe, I get the attached error message. I know, I am typing the password correctly and it works with Notepad.
    Run as different user in Windows 10-screenshot-2021-08-03-222441.jpg
      My Computer

  4. Brink's Avatar
    Posts : 59,147
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #4

    Hello @selim,

    I'm getting the same with explorer.exe.
      My Computers


  5. Posts : 9
    Windows 10
       #5

    Hi @Brinks.
    I guess explorer can be more dangerous than Notepad, so it is more secure.
    I saw some info about editing the registry entry but I wasn't able to find the reg key to modify.
      My Computer


 

Tutorial Categories

Run as different user in Windows 10 Tutorial Index Network & Sharing Instalation and Upgrade Browsers and Email General Tips Gaming Customization Apps and Features Virtualization BSOD System Security User Accounts Hardware and Drivers Updates and Activation Backup and Restore Performance and Maintenance Mixed Reality Phone


  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 21:14.
Find Us




Windows 10 Forums