How to open CMD in a folder as administrator on Windows 11

To open CMD in a folder as administrator on Windows 11, set Windows Terminal to always launch your shell with admin rights, then right-click the folder and choose "Open in Terminal".

This method works for both Command Prompt and PowerShell. Once set up, every time you right-click a folder and click "Open in Terminal", the window opens in that folder with admin rights. No more typing cd paths.

ADVERTISEMENT

How to open CMD in a folder as administrator on Windows 11

  1. Open Windows Terminal. You'll change two settings in it.
    Open Windows Terminal
  2. Click the drop-down arrow located next to the tabs.
  3. Click Settings.
    Open Windows Terminal settings
  4. At 'Default profile', select Command Prompt or PowerShell.
    Select default profile in Terminal
  5. In the left menu, click the same profile you just set as default (Command Prompt or PowerShell).
    Command Prompt profile settings in Terminal
  6. Turn on the Run this profile as Administrator option.
    Run this profile as Administrator option in Terminal
  7. Click Save.
  8. Close the Terminal window.
  9. Open File Explorer.
  10. In File Explorer, right-click the folder.
  11. Click Open in Terminal.
    Open CMD in a folder as administrator
ADVERTISEMENT

Related:

Remove the PowerShell update message in Windows Terminal


Windows