Run as Different User

Written by

in

ShellRunas is a free Microsoft Sysinternals utility that allows you to launch Windows programs under different user credentials via the graphical user interface (GUI). While Windows includes a native command-line tool called runas, ShellRunas bridges the gap for heavy File Explorer users by embedding this functionality directly into the right-click context menu. Key Features

GUI Integration: Adds a “Run as different user” option to your standard right-click context menu for quick account switching.

Network-Only Authentication: Includes a /netonly flag, allowing you to run a local program using different credentials strictly for remote network access (ideal for accessing off-domain SQL servers or file shares).

Lightweight: It is a portable tool that does not require a complex installation process; it simply hooks into your existing system registry. Common Use Cases

System administrators and power users frequently use ShellRunas to follow the “least privilege” security model. Instead of logging out of a standard, secure user account to perform administrative tasks, an IT pro can right-click a management tool (like SQL Server Management Studio) and temporarily run it with elevated domain admin credentials. Command Syntax & Setup

To download the tool, visit the Microsoft Learn Sysinternals ShellRunas Page.

Once downloaded, you must register the tool to the Windows Shell using a command prompt with the following syntax:

:: To register the right-click context menu item shellrunas /reg :: To register it specifically for network-only credentials shellrunas /regnetonly :: To remove the context menu entry entirely shellrunas unreg Use code with caution. Important Usage Quirks

Per-User Basis: Running shellrunas /reg applies changes to the HKEY_CURRENT_USER (HKCU) registry hive, meaning it must be run individually for every user account using the machine.

Explicit Executables Only: If you call ShellRunas via the command line, it requires a direct path to an executable (.exe). It cannot directly run snap-ins like .msc files unless you explicitly call mmc.exe first and pass the snap-in as an argument.

Quoting Paths: If your file paths contain spaces, you must wrap the target executable path in quotation marks to prevent a “system cannot find the file specified” error. (sysinternals) ShellRunAs.exe Prompted For Eula #1777