Running Command Prompt as administrator in Windows 11

Many commands only work with administrator rights: sfc /scannow, DISM, chkdsk, editing the hosts file or installing a PowerShell module for all users. Open Command Prompt the normal way and you get "Access is denied" or "The requested operation requires elevation". This article shows six ways to open Command Prompt (cmd), PowerShell or Windows Terminal as administrator in Windows 11 and Windows 10, how to check that it worked, and what to do when the option is missing.

Quick overview

MethodHowWindows 10Windows 11
Start menuSearch cmd > Run as administratorYesYes
Keyboard shortcutSearch cmd > Ctrl + Shift + EnterYesYes
Win + X menuTerminal (Admin) or Windows PowerShell (Admin)YesYes
Run dialogWin + R, type cmd, Ctrl + Shift + EnterYesYes
Task ManagerRun new task with administrative privilegesYesYes
sudosudo for a single commandNoFrom 24H2

Method 1: from the Start menu

  1. Click Start or press the Windows key.
  2. Type cmd (or command prompt).
  3. Click Run as administrator on the right of the search results. You can also right-click Command Prompt.
  4. Click Yes in the User Account Control (UAC) prompt.

The same works for powershell and terminal.

Method 2: the Ctrl + Shift + Enter shortcut

The fastest way without a mouse: press the Windows key, type cmd and press Ctrl + Shift + Enter instead of just Enter. Windows immediately shows the UAC prompt. Click Yes to confirm.

Method 3: the Win + X menu

Press Windows + X (or right-click the Start button).

The Win + X menu in Windows 11 with Terminal (Admin)

Method 4: the Run dialog

  1. Press Windows + R.
  2. Type cmd (or powershell, or wt for Windows Terminal).
  3. Press Ctrl + Shift + Enter. Plain Enter or OK opens the window without administrator rights.

Method 5: Task Manager

Useful when the Start menu or File Explorer hangs.

  1. Open Task Manager with Ctrl + Shift + Esc.
  2. Click Run new task (in Windows 10: File > Run new task).
  3. Type cmd and tick Create this task with administrative privileges.
  4. Click OK.

Method 6: sudo in Windows 11 (24H2 and later)

Since the Windows 11 2024 Update (version 24H2), Windows has its own sudo command, like Linux and macOS. It runs a single command with administrator rights from a normal window.

  1. Open Settings > System > For developers.
  2. Turn on Enable sudo.
  3. Choose how sudo runs applications: in a new window, with input disabled or inline (in the same window).

Then type, for example:

sudo sfc /scannow
sudo notepad C:\Windows\System32\drivers\etc\hosts

You still get a UAC prompt, but you no longer need to open a separate admin window. In a company environment your administrator can turn sudo off by policy; the option is then greyed out.

How do you know you are running as administrator?

Always open Windows Terminal as administrator

If you often need administrator rights, you can make a Windows Terminal profile start elevated by default:

  1. Open Windows Terminal and press Ctrl + , (settings).
  2. Pick the profile on the left, for example Command Prompt.
  3. Turn on Run this profile as Administrator and click Save.

Use this sparingly: everything you start in that window has full rights on your computer.

Troubleshooting

Next: installing PowerShell modules

A common reason to open PowerShell as administrator is installing modules for all users, such as the Microsoft Teams or Exchange Online module.

Running PowerShell as administrator from the Start menu

Read also

How to edit the hosts file in Windows 11 and Windows 10
Turn Windows features on or off in Windows 11 and 10: 4 ways
Find and delete large files in Windows 11 and 10: 5 ways

Nederlandstalige versie: Opdrachtprompt als administrator uitvoeren in Windows 11 en 10: 6 manieren


More in English