For some important tasks in Windows, you need to open the Command prompt and run it as an administrator. For example, if you want to run Diskpart, which allows you to list, create, or delete partitions at the command line, you need to open CMD (aka the command prompt app) as administrator. For some tasks, you may prefer to use PowerShell, which has all the functionality of the Command prompt but adds in advanced scripting capabilities / cmdlets.When you run CMD as admin, it’s called running an elevated Command prompt, because your privileges are elevated. If you are an administrator of your PC – likely the case if you bought or built your own computer – your primary user probably has admin rights (if you were issued a corporate computer from work or school, maybe not). You just need to exercise those rights, because by default, neither the command prompt nor PowerShell runs as admin.

How to Run Cmd as Admin Using Right Click

The easiest way to run any program, including CMD, with admin rights inWindows 11or 10 is to search for it in Windows search then right click the icon and select Run as Administrator.

It almost goes without saying that, unless you have disabled User Account Control, Windows will present you with a confirmation dialog box asking if you are sure you want to run CMD as an admin.This same method works for PowerShell or any other program you wish. However, I hate using this method because it adds a step of right-clicking and then choosing an item from the context menu. On a laptop with a stiff or slippery touchpad, you could end up having to try a couple of times to right-click and select Run as Administrator.

CMD and PowerShell running as administrator

How to Configure Cmd to Always Run as Admin

I can’t think of a time when I’d want to run the command prompt or PowerShell and not have them run in admin mode. Fortunately, there’s a way to make each program (or any program) default to running as admin as soon as you click its shortcut. Here’s how to do it for the Command prompt, but the same steps would work for PowerShell.1.Search for “command prompt"or “CMD” in Windows Search.2.Right-click on the top resultandselect Open File Location.

The location of the shortcut for Command prompt will open in Windows Explorer.3.Right-click on the Command Prompt shortcut iconandselect Properties.

Right click command prompt and run as admin

5.Toggle Run as Administrator to Onandclick OK.

Get Tom’s Hardware’s best news and in-depth reviews, straight to your inbox.

6.Click Ok in the Command Prompt properties boxto close it.Next time you search for “CMD” or “command prompt” and click the top result, you will get an administrative command prompt.Note that an elevated Command Prompt will, as asecuritymeasure, always launch in C:\Windows\System32 — the shortcut’s “Start in” field gets ignored. If you want to launch an elevated Command Prompt in a different folder, like C:\Users, you can get around the restriction by passing a change directory (or pushd) command to the prompt via the /k option. To do this, change the Target to include the extra parameters like this:%windir%\system32\cmd.exe /k “pushd C:\Users”

select open file location

Use CTRL + Shift Enter to Launch Cmd as Administrator

Let’s say you want to launch an elevated command prompt, but you don’t want to change the command prompt shortcut so it happens every time. No problem. You can use the keyboard shortcutCtrl + Shift + Enterwhen you select the command prompt icon from Start or even when you run CMD from the run dialog.

3.Hit Ctrl + Shift + Enter.

Use the Windows + X Context menu to launch PowerShell as Admin

This method only works for PowerShell, but as we’ve said, PowerShell can do everything that CMD can do and more.

1.Hit Windows key + X.A long context menu will appear on the desktop.

select properties

  1. Select Terminal (admin)

A PowerShell window with admin privileges will launch.

Avram Piltch is Managing Editor: Special Projects. When he’s not playing with the latest gadgets at work or putting on VR helmets at trade shows, you’ll find him rooting his phone, taking apart his PC, or coding plugins. With his technical knowledge and passion for testing, Avram developed many real-world benchmarks, including our laptop battery test.

Click Advanced

toggle run as administrator to On and Click Ok

type cmd into the run dialog box

select Terminal Admin

Avram Piltch