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

Need to run command-line tools with elevated privileges directly from a specific directory? While Microsoft changed the classic Shift + Right-click behavior in recent updates, Windows 11 provides a seamless native workaround using the new Windows Terminal application.

In this step-by-step tutorial, I will show you how to configure your system settings so you can instantly open CMD in a folder as administrator on Windows 11. This method works perfectly for the standard Command Prompt, Windows Terminal, and PowerShell, saving you from manually typing long file paths using the cd command.

How to run Command Prompt as administrator in any folder

  1. First, you'll have to change two settings. To do so, open Windows Terminal.
    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 'Profiles' section in the left menu, click Command Prompt or PowerShell, depending on what you've selected in the previous step.
    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 at the bottom of the window.
  8. Close the Terminal window.
  9. Open File Explorer.
  10. Right-click the folder.
  11. Click Open in Terminal.
    Open CMD in a folder as administrator

Related:

Remove the PowerShell update message in Terminal & PowerShell


Windows