Windows start program as user

How to Run a Program as a Different User (RunAs) in Windows 10?

In all supported Windows versions it is possible to run applications on behalf of another user (Run As) in the current session. This allows you to run a script (.bat, .cmd, .vbs, .ps1), an executable (.exe) or an application installation (.msi, .cab) with another user (usually elevated) privileges.

For example, you can use the RunAs to install apps or run MMC snap-ins under the administrator account in an unprivileged user session. The opportunity to run a program as a different user may be useful when an application is configured under another user (and stores its settings in another user’s profile, which the current user cannot access), but it must be started with the same settings in another user’s session.

In Windows 10 there are several ways to run a program/process on behalf of another user.

How to Run an App as Different User from File Explorer?

The easiest way to run an application on behalf of another user is to use the Windows File Explorer GUI. Just find an application (or a shortcut) you want to start, press the Shift key and right-click on it. Select Run as different user in the context menu.

[alert]Note. If the menu item “Run as different user” is missing, see the next section.

In the next window, specify the name and password of the user under whose account you want to run the application and click OK.

Open the Task Manager and make sure that the application is running under the specified user account.

“Run As Different User” Option is Missing in Windows 10

If there is no Run as different user option in the File Explorer context menu, open the Local Group Policy Editor ( gpedit.msc ) and make sure that the Require trusted path for credential entry policy is disabled (or not configured) in Computer Configuration -> Administrative Templates -> Windows Components -> Credential User Interface.

Using the RunAs Command to Run a Program as Another User from CMD

You can use the Windows built-in cli tool runas.exe to run apps applications as a different user from the command prompt. The runas command also lets you to save the user’s password to the Windows Credential Manager so that you don’t have to enter it every time.

Open the command prompt (or the Run window by pressing Win+R). To start the Notepad.exe under the administrator account, run this command:

Читайте также:  Sprint layout linux wine

runas /user:admin «C:\Windows\notepad.exe»

runas /user:»antony jr» notepad.exe

In the next window, the prompt “Enter the password for admin” appears, where you have to enter the user’s password and press Enter.

Your application should open. In my case, this is cmd.exe. The window title says “running as PCName\username“:

For example, you can open the Control Panel under a different user:

runas /user:admin control

If you need to run a program under a domain user, use the following name format: UserName@DomainName or DomainName\UserName . For example, to open a text file using notepad on behalf of a domain user, use the command:

runas /user:corp\server_admin «C:\Windows\system32\notepad.exe C:\ps\region.txt»

Sometimes you need to run a program as a domain user from a computer that is not joined to the AD domain. In this case, you need to use the following command (It is assumed that the DNS server specified in your computer’s network settings can resolve this domain name):

runas /netonly /user:contoso\bmorgan cmd.exe

If you don’t want to load user profile when starting the program as different user, use the /noprofile parameter. This allows the application to launch much faster, but may cause incorrect operation of programs that store app data in the user’s profile.

How to Use RunAs Without Password Prompt?

You can save the user credentials (with password) that you enter. The /savecred parameter is used for this.

runas /user:admin /savecred “C:\Windows\cmd.exe”

After specifying the password, it will be saved to the Windows Credential Manager.

The next time you run the runas command under the same user with the /savecred key, Windows will automatically use the saved password from the Credential Manager without prompting to enter it again.

To display a list of saved credentials in Credential Manager, use the following command:

rundll32.exe keymgr.dll, KRShowKeyMgr

However, using the /savecred parameter is not safe. Because a user, in which profile it is saved, can use it to run any command with these privileges and even change another user password. Also, it is easy to steal passwords saved in the Credential Manager so it is recommended to prevent a Windows from saving passwords (and never save the password of the privileged administrator accounts).

How to Create a Shortcut to Run As Different User?

You can create a shortcut on your desktop that allows you to run the program as a different user. Just create a new shortcut, and specify the runas command with the necessary parameters in the Location field

When you run such a shortcut, you will be prompted to enter a user password.

If you additionally specify the /savecred parameter in the runas shortcut, then the password will be prompted only once. The password will be saved in Credential Manager and automatically used when you running the shortcut without prompting for a password.

Such shortcuts are quite often used to run programs that require elevated permissions to run. However, there are safer ways to run a program without administrator privileges, or disable the UAC prompt for a specific application.

How to Run MMC Snap-Ins As a Different User?

In some cases, you have to run one of Windows management snap-ins as a different user. For example, you can use the following command to run the Active Directory Users and Computers (ADUC) RSAT snap-in as a different user:

runas.exe /user:DOMAIN\USER «cmd /c start \»\» mmc %SystemRoot%\system32\dsa.msc»

In the same way you can run any other snap-in (if you know its name).

Add “Run As” Option to Start Menu in Windows 10

By default in Windows 10 Start Menu items do not have the “Run As” option. To add the context menu “Run as different user”, enable the “Show Run as different user command on Start” policy in User Configuration -> Administrative Templates ->Start Menu and Taskbar section of the Local Group Policy Editor (gpedit.msc).

Читайте также:  Linux ubuntu install errors

Or, if the gpedit.msc is missing, create a new DWORD parameter with the name ShowRunasDifferentuserinStart and value 1 in the registry key HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Explorer. You can use the following PowerShell command to add the reg parameter:

New-ItemProperty -Path «HKCU:\Software\Policies\Microsoft\Windows\CurrentVersion\Explorer» -Name ShowRunasDifferentuserinStart -Value 1 -PropertyType DWORD -Force

Update the Group Policy settings ( gpupdate /force ) and make sure that a new context menu More -> Run as different user has appeared for the programs in the Start menu.

How to run apps as administrator on Windows 10

Source: Windows Central

On Windows 10, the ability to run an app as administrator is an essential skill that every user should know because, by design, apps operate in user mode to prevent potential unwanted system changes that may negatively affect the experience. However, sometimes, some trusted programs may require elevated permissions to work as intended, and knowing the steps to run them with appropriate permissions will come in handy.

Whatever your reason it might be, Windows 10 includes several methods to quickly start an app with elevated privileges using the Start menu, File Explorer, Command Prompt, and more.

But remember that this is only true for traditional desktop (Win32) programs since apps available through the Microsoft Store can’t run elevated.

In this Windows 10 guide, we’ll walk you through the different ways to launch an app with administrator privileges to complete an elevated task.

How to run app as administrator using Stat menu

Using the Start menu, you have at least two quick ways to start an application as an administrator.

Start context menu

To run a program as administrator from the Start menu context menu, use these steps:

  1. Open Start.
  2. Right-click the app (anywhere on the menu).

Select the More submenu, and click the Run as administrator option.

Source: Windows Central

Start menu keyboard shortcut

To start an app with admin right using the keyboard shortcut, use these steps:

  1. Open Start.
  2. Use the Ctrl + Shift keyboard, and click the app from the list.
  3. (Optional) Select app using the arrows keys.
  4. Use the Ctrl + Shift + Enter keyboard shortcut.

If you use the search experience, you also have two ways to run apps with administrative permissions.

Search result menu

To open an app as an administrator from the search box, use these steps:

Open Start.

Quick tip: You can also open search directly from the taskbar (if available), or use the Windows key + S keyboard shortcut.

Click the Run as administrator option from the right side. (Sometimes, the option is hidden until you click the down-arrow button.)

Source: Windows Central

(Optional) Right-click the app and select the Run as administrator option.

Source: Windows Central

Search keyboard shortcut

To run a program from search with a keyboard shortcut, use these steps:

  1. Open Start.
  2. Search for the app.
  3. Use the Ctrl + Shift + Enter keyboard shortcut.

How to run app as administrator using desktop

On Windows 10, you can also start apps elevated from the desktop or taskbar.

Desktop context menu

To start an app with elevated privileges from the desktop, use these steps:

    Use the Windows key + D keyboard shortcut to view the desktop.

Right-click app, and select the Run as administrator option.

Source: Windows Central

Taskbar context menu

To run apps elevated from the taskbar, use these steps:

  1. Right-click the app in the taskbar.
  2. Right-click the app name.

Select the Run as administrator option.

Source: Windows Central

How to run app as administrator using Run

To start a program as an admin user from the Run command, use these steps:

    Open Start.

Search for Run and click the top result to open the app.

Quick tip: You can also open the Run command using the Windows key + R keyboard shortcut.

Type the name of the app. For example, explorer.exe.

Source: Windows Central

  • Use the Ctrl + Shift keyboard shortcut and click the OK button.
  • How to run app as administrator using Task Manager

    To launch an app as an administrator from Task Manager, use these steps:

      Open Start.

    Search for Task Manager and click the top result to open the app.

    Quick tip: Other alternative ways to open the experience include, right-clicking the taskbar and selecting the Task Manager option. Using the Ctrl + Shift + Esc keyboard shortcut, and using the Ctrl + Alt + Delete shortcut and clicking the Task Manager option.

    Select the Run new task option.

    Source: Windows Central

    Check the Create this task with administrator privileges.

    Source: Windows Central

    How to run app as administrator using File Explorer

    File Explorer includes at least two ways to launch apps as an administrator user.

    Context menu

    To open app elevated with File Explorer, use these steps:

    1. Open File Explorer.
    2. Navigate to the folder with the executable file.

    Right-click the app and select the Run as administrator option.

    Source: Windows Central

    Ribbon menu

    To run a program as an administrator with the ribbon menu, use these steps:

    1. Open File Explorer.
    2. Navigate to the folder with the executable file.
    3. Select the app.
    4. Click the Application Tools tab.

    Click the Run as administrator button.

    Source: Windows Central

    Quick note: If you click the arrow button, then you can select to launch the app as admin or as a different user.

    How to run app as administrator using Command Prompt

    To run an app elevated from Command Prompt, use these steps:

    1. Open Start.
    2. Search for Command Prompt and click the top result to open the console.

    Type the following command to run an app with administrator privileges and press Enter:

    `runas /user:»COMPUTER-NAME\ADMIN-USER» «C:\PATH\TO\PROGRAM.EXE»

    In the command, make sure to update the syntax with your computer name and administrator user and with the correct path of the program.

    For example, this command start PowerShell 7 with administrator privileges:

    runas /user:»office-pc\user@email.com» «C:\Program Files\PowerShell\7\pwsh.exe»

    Source: Windows Central

  • Confirm the password and press Enter.
  • If you want to run an app always as an administrator, you can use these steps.

    More Windows 10 resources

    For more helpful articles, coverage, and answers to common questions about Windows 10, visit the following resources:

    Halo: MCC’s live service elements make it better, not worse

    Halo: The Master Chief Collection is more popular than ever, but some fans don’t agree with the live service approach 343 Industries has taken with it. Here’s why those elements are, at the end of the day, great for the game and for Halo overall.

    Microsoft’s Surface Duo is not ‘failing up’

    Microsoft announced this week that it was expanding Surface Duo availability to nine new commercial markets. While Surface Duo is undoubtedly a work in progress, this is not a sign of a disaster. It’s also doesn’t mean that Surface Duo is selling a ton either. Instead, the reason for the expansion is a lot more straightforward.

    Here’s what you can do if Windows 10 update KB5001330 is causing issues

    In this guide, we’ll show you the steps to get rid of the update KB5001330 to fix profile, gaming, and BSoD problems with the Windows 10 October 2020 Update and May 2020 Update.

    These are the best PC sticks when you’re on the move

    Instant computer — just add a screen. That’s the general idea behind the ultra-portable PC, but it can be hard to know which one you want. Relax, we have you covered!

    Читайте также:  Windows 10 применить изменения реестра без перезагрузки
    Оцените статью