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 in Windows 11 or 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.
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 result and select Open File Location.

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

4. Click Advanced .

5. Toggle Run as Administrator to On and click OK .

6. Click Ok in the Command Prompt properties box to close it.
Next time you search for "CMD" or "command prompt" and click the top result, you will get an administrative command prompt.
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 shortcut Ctrl + Shift + Enter when you select the command prompt icon from Start or even when you run CMD from the run dialog.
To use the run dialog to launch cmd as administrator:
1. Hit Windows key + R to open the run dialog box.
2. Type cmd into the run dialog box.

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.
2. Select Terminal (admin)

A PowerShell window with admin privileges will launch.
