Windows 11: always run Command Prompt and PowerShell as Administrator

Windows 11 includes two ways to make Command Prompt and PowerShell always run as Administrator. By default, Windows launches PowerShell, Command Prompt, and Windows Terminal without elevated privileges. If an app, script, or command requires an Administrator access level, the user needs to close Command Prompt and relaunch it with elevated privileges.
In this tutorial, we will show you how to make Command Prompt and PowerShell always run with elevated privileges, regardless of how you open the app.

Always run Command Prompt as Administrator in Windows 11

However, we don’t recommend you running the console as Administrator unless an app, script, or command requires it. This article is primarily for those who frequently need Command Prompt with elevated privileges.
When you run Windows Terminal with elevated privileges, the app displays a shield icon in the upper-left corner of the window.

Always run Command Prompt as Administrator in Windows 11

  1. Right-click the Start menu icon in the taskbar and select “Windows Terminal”.Open Windows Terminal
  2. Click the arrow-down menu button next to tabs and select “Settings”(Ctrl + , ).Select settings
  3. Click “Command Prompt” on the left.
  4. On the right panel, look for the “Run this profile as Administrator” option and enable it.Always Open As Admin Command Prompt
  5. Click “Save” to apply changes.

If you prefer changing Terminal options in the JSON file, you need to add one “elevated” value to the Command Prompt profile.

The JSON option

  1. Run Windows Terminal and open its settings.
  2. Click the “Open JSON file” button at the bottom left.the open JSON file button
  3. Find “Command Prompt” in the list of profiles.
  4. Add "elevate": true, to the profile body between the curly brackets. Don’t forget to end the line with a comma.Windows 11 Always run Command Prompt as Administrator
  5. Save the changes and close Notepad(or any other text editor that opens).

Now you may want to use your modified Command Prompt profile as the default Windows Terminal profile. That will ensure Terminal launches as Command Prompt.

Set modified profile as default Terminal Profile

  1. Open your Windows Terminal settings.
  2. Select the “Startup” tab in the left panel.
  3. Find the “Default profile” option and change it to your edited “Command Prompt”.Set default Terminal Profile
  4. Click “Save” to apply the changes.

From now, Windows Terminal will always open to the elevated command prompt.

Always run PowerShell as Administrator

The idea here is exactly the same as we used for the command prompt. After you modify the profile for PowerShell, set it as your default profile.

To always run PowerShell as Administrator in Windows 11, do the steps below.

  1. Open settings in Windows Terminal, and select PowerShell on the left.
  2. Enable the “Run this profile as Administrator” option on the right.
  3. Click Save to apply the change.
  4. Now, return to the settings and select “Startup” in the left panel.
  5. Select “PowerShell” as your default Windows Terminal profile.Always run PowerShell as Administrator
  6. Alternatively, open the JSON file by clicking the appropriate button in Terminal Settings, and add "elevate": true, similar to the Command Prompt profile reviewed earlier.

From now, every time you launch Windows Terminal, it will open to the elevated PowerShell. It will also show a User Account Control prompt which you need to confirm by clicking Yes.

Method 2 – A desktop shortcut

A shortcut with extra settings is yet another method to always open Command Prompt or PowerShell as Administrator in Windows 11. Here is how to create such a shortcut.

  1. Right-click the desktop select “New > Shortcut” from the menu.
  2. In the “Create Shortcut” dialog, enter powershell.exe in the “Type the location…” box, and click Next.
  3. For a Command Prompt shortcut, type cmd.exe in the “Type the location…” box; then click Next.Type cmd in the location box
  4. Give your shortcut a proper name like “PowerShell (Administrator)” or “Command Prompt (Administrator)”.Shortcut name
  5. Finally click on the “Finish” button.
  6. Now right-click the shortcut you just created and select “Properties.”.
  7. Click the “Advanced” button on the “Shortcut” tab.
  8. In the “Advanced properties” box, enable the the “Run as Administrator” setting and click “OK” in every open dialog.Always run command prompt as Administrator from shrortcut

You can now open PowerShell or Command Prompt as Administrator in Windows 11 with a single click on the desktop shortcut. You can pin such shortcut to the taskbar or Start menu for even faster access.

Looks like you've read the post to the end. If you enjoyed it, please share it. You would greatly help our blog to grow!

Author: The MFTNEXT Team

The MSFTNEXT project is a small team of authors who love to engage with the latest technology and gadgets. Being passionate Windows bloggers, we are happy to help others fix their system issues.

Leave a Reply

Your email address will not be published.

css.php