TECH / Windows 3 min read

How to Run a Program as Administrator from Command Prompt (cmd, runas & PowerShell)

Antonio NEMCD Author
Published Mar 14, 2015 · 3 min

On Windows, you frequently need to launch an app or script from Command Prompt with elevated administrator rights – or run it under a different user account (like a local or domain admin). Here are three reliable methods for Windows 10, Windows 11, and older Windows releases, plus a quick note on the UAC quirk that trips people up.

Running a program from Windows Command Prompt via runas

Quick answer: to launch a program with elevated UAC admin privileges from a regular Command Prompt, use PowerShell’s Start-Process wrapper: powershell -Command "Start-Process notepad -Verb RunAs". To run an app under another user account, use runas /user:Administrator calc.

Method 1. Elevate to Administrator (UAC) Directly from cmd

A classic gotcha on Windows 10 and 11 is that built-in runas.exe does not trigger UAC elevation – it starts the process under the target account with a standard non-elevated token (I tried using runas to bypass UAC over TeamViewer years ago and hit that exact wall).

To genuinely launch an elevated admin process from an ordinary cmd window, call PowerShell with -Verb RunAs:

powershell -Command "Start-Process cmd -Verb RunAs"
powershell -Command "Start-Process notepad.exe 'C:\Windows\System32\drivers\etc\hosts' -Verb RunAs"

Windows pops up the standard UAC prompt and launches the app with full administrator permissions.

Method 2. Use runas.exe to Run Under Another Account

When you specifically want to start a tool under a different account (such as a local admin on a workstation or a domain administrator), use built-in runas.exe:

runas /user:Administrator calc
# for a domain account:
runas /user:DOMAIN\admin "mmc.exe"

Enter the account password when prompted (typing stays invisible – that is normal). Two handy runas switches:

  • /savecred – stores the password in Windows Credential Manager so you do not have to retype it every time (convenient on personal machines, avoid on shared PCs).
  • /netonly – runs locally while authenticating network connections with the specified domain credentials (great for running AD consoles or accessing domain shares from a non-domain laptop).

Method 3. Instant Elevated Shell via Win + R & Fixing PATH

  • From the Run dialog (Win + R): type cmd and press Ctrl + Shift + Enter instead of plain Enter – Command Prompt opens elevated right away, and anything launched inside it inherits administrator privileges.
  • Program in PATH not found when running as another user (reader question): each Windows user has their own user-level PATH. If a tool like Sublime Text or Python works in normal cmd but fails under an admin account, move its folder into the System Path variable (System Properties → Environment Variables → System variables → Path).

Related Windows admin tip: how to sign in as a local administrator on a domain-joined PC.

For interactive tasks, Win + R followed by Ctrl + Shift + Enter is unbeatable; for batch scripts and shortcuts, powershell -Command "Start-Process ... -Verb RunAs" handles UAC cleanly across every modern version of Windows.

Related posts:

Leave a Comment