ContextCleaner: see every entry in the Windows 11 right-click menu, and which app added it — on the Microsoft Store.
Windows Tips & Tools PortDetective

How to Run Command Prompt as Administrator in Windows 11 and 10 (6 Ways)

Published October 23, 2026 Updated October 23, 2026 8 min read

To run cmd as administrator, select Start, type cmd, right-click Command Prompt and select Run as administrator, then select Yes in the User Account Control prompt. The window title then starts with “Administrator:”. On Windows 11 version 24H2 or later you can also turn on sudo and run single commands elevated from a normal window.

Below are six methods that work on Windows 11 and 10, how to confirm you really are elevated, and what to do when Windows refuses. If you only need an admin prompt to find which program holds a port, there is a shortcut at the end using Port Detective.

How do I open Command Prompt as administrator from Start?

This is the method Microsoft itself gives in its System Information support article: “Type cmd in the search box. In the search results, right-click Command Prompt, and then select Run as administrator.”

  1. Select Start (or press the Windows logo key).
  2. Type cmd.
  3. Right-click Command Prompt in the results.
  4. Select Run as administrator.
  5. Select Yes in the User Account Control prompt. If you use a standard account, enter an administrator’s password instead.

It works the same way in Windows 10 and Windows 11.

Six ways to run cmd as administrator

#MethodWindows 11Windows 10Best for
1Start search, right-click, Run as administratorYesYesEveryone
2Win+X menu, (Admin) entryYesYesKeyboard users
3Ctrl+Shift+click a taskbar iconYesYesPinned Command Prompt or Terminal
4PowerShell Start-Process cmd -Verb RunAsYesYesScripts
5Typing cmd inside an elevated windowYesYesAlready elevated
6sudo24H2 or laterNoOne command at a time

Is there a keyboard shortcut to run cmd as administrator?

Win+X menu. Press Windows logo key + X to open the Quick Link menu, the same menu you get by right-clicking Start. Microsoft’s Windows Terminal FAQ says you can open this menu and select Windows Terminal (Admin). The label can differ on older builds, so pick the entry marked (Admin). Approve the UAC prompt, then open a Command Prompt tab in Terminal, or type cmd.

Taskbar shortcut. Microsoft’s keyboard shortcuts list includes “Ctrl+Shift+select an app icon on the taskbar: Open the app as an administrator.” Pin Command Prompt or Terminal to the taskbar once, and Ctrl+Shift+click gives you an elevated window. The same list also offers Windows logo key + Ctrl + Shift + a number to open the pinned app at that taskbar position as an administrator.

How do I run cmd as administrator without right-clicking?

From PowerShell. Microsoft’s Start-Process documentation shows that the RunAs verb starts a program elevated. Its example opens PowerShell; the same parameter works for cmd:

Start-Process -FilePath "cmd" -Verb RunAs

You still get a UAC prompt. That is by design.

From an elevated window. Microsoft’s How User Account Control works explains that child processes inherit the access token of the process that started them. So if Terminal or PowerShell is already running as administrator, typing cmd there gives you an elevated Command Prompt with no second prompt.

How do I use sudo on Windows 11?

Sudo for Windows arrived in Windows 11 version 24H2. Microsoft’s sudo documentation gives the setup:

  1. Open Settings > System > Advanced.
  2. Turn on Enable sudo.
  3. In any Command Prompt or PowerShell window, put sudo in front of a command, for example sudo netstat -ab.

A UAC prompt still appears for each elevation. Sudo has three modes:

  • In a new window (forceNewWindow, the default): the command runs in a new elevated console.
  • Input closed (disableInput): the elevated process runs in your current window, but with its input handle closed.
  • Inline (normal): the command runs in your current window and can take input, most like sudo on other systems.

Microsoft warns that sudo “can be used as a potential escalation of privilege vector when enabled in certain configurations”, and lists extra risks for the Input closed and Inline modes, so read its security notes before switching from the default. Windows 10 does not have sudo.

How can I tell if Command Prompt is running as administrator?

  • The title bar. An elevated window’s title starts with “Administrator:”, for example “Administrator: Command Prompt”.
  • whoami. Microsoft’s whoami reference lists whoami /groups to show your group memberships and whoami /priv to show your privileges. Run whoami /priv in a normal window and in an elevated one and compare: the lists differ because, as Microsoft’s UAC documentation explains, an administrator gets a separate full access token only when elevated.

Why can’t I run Command Prompt as administrator?

Microsoft’s UAC documentation covers the usual reasons:

  • You use a standard account. When a standard user tries to run something that needs an administrator token, UAC asks for valid administrator credentials. Without them, you cannot elevate.
  • You are an admin but the window is not elevated. Administrators also run apps with a standard user token by default. Opening cmd normally does not elevate it; you have to approve elevation with one of the methods above.
  • Your organization restricts it. On work PCs, UAC behaviour can be set by policy. Ask IT rather than looking for a workaround.

Turning off UAC is not a fix. It removes a key protection for every app on the PC.

Opening an admin prompt just to find what is using a port?

A common reason to elevate is netstat -b, which shows the program behind each connection. Microsoft’s netstat reference notes that -b “will fail unless you have sufficient permissions”. Elevated, this lists connections with process names, numeric addresses and PIDs, filtered to one port:

netstat -abno | findstr :3000

-a shows all connections and listening ports, -n keeps addresses numeric, and -o adds the PID. If you only need the PID, netstat -ano works without elevation. For more filters, see our netstat guide for developers or how to find the process using a port. If the port is blocking a dev server, fixing EADDRINUSE on Windows has the full workflow.

If that is the only reason you opened an admin prompt, the free edition of Port Detective shows the same information in a live table. Per its Store listing, it tracks every active TCP and UDP connection and lets you type a port number to see the process name, PID and connection state. It does not run commands elevated or change network settings. If netstat already does the job for you, you do not need it.

See which process owns a port without parsing netstat output.

Get it from Microsoft

Other lookups that are usually run from an admin prompt include openfiles for open files and powercfg /requests for what keeps a PC awake.

Frequently asked questions

What is the command to run Command Prompt as administrator?

From PowerShell, run Start-Process cmd -Verb RunAs. On Windows 11 24H2 or later with sudo enabled, put sudo in front of the single command you want elevated.

How do I run PowerShell as administrator in Windows 11?

Use the same methods: right-click Windows PowerShell or Terminal in Start search and select Run as administrator, use the Win+X (Admin) entry, or run Microsoft’s own example Start-Process -FilePath "powershell" -Verb RunAs.

How can I check if I have local admin rights?

Run whoami /groups and look for the Administrators group in the list. To confirm the current window is elevated, check that its title starts with “Administrator:”.

Why can’t I run Command Prompt as administrator in Windows 11?

Most often the account is a standard user, so UAC asks for an administrator’s password. On a work PC, policy may block elevation. Microsoft’s UAC documentation explains both cases.

Is sudo for Windows safe?

It uses the same UAC prompt as other methods. Microsoft notes that sudo can be used as a potential escalation of privilege vector in certain configurations and describes extra risks for the Input closed and Inline modes, so the default new window mode is the cautious choice.

Try Port Detective

Port Detective Free is in the Microsoft Store for live port and process lookup. Port Detective Pro, an optional one-time upgrade in the Microsoft Store, adds tools such as Port Guard alerts and one-click process termination. More detail is on the Port Detective product page.

Find the process behind any port in a live Windows table.

Get it from Microsoft

Windows is a trademark of the Microsoft group of companies. Port Detective is not affiliated with or endorsed by Microsoft.

Last updated 23 October 2026. Published by Automata Labs, a software company in Canada.

// release_radar

Get notified about new releases.

We build native, local-first tools for professionals who refuse SaaS fatigue. Drop your email to hear about new apps, major updates, and zero-telemetry releases as they land on the Microsoft Store. No spam — just release news.