On Windows 11, when you right-click inside a folder, you will find the option to open that File Explorer path in Command Prompt, but you won’t find an entry to open the console as an administrator.

However, if you must open a particular folder location in File Explorer with Command Prompt as an administrator to run an application, it’s possible to add an entry to the classic context menu through the Registry.

In this guide, you will learn the steps to add a new entry in the File Explorer context menu to open a specific path in Command Prompt as an administrator on Windows 11 (or Windows 10).

Open Command Prompt as admin from File Explorer

To open Command Prompt as an administrator from the File Explorer context menu on Windows 11, use these steps:

  • Open Start on Windows 11.
  • Search for regedit and click the top result to open the app.
  • Navigate to the following path:
  • HKEY_CLASSES_ROOT\Directory\Background\shell
  • Right-click the “shell” key (folder), select New, and choose the Key option.
  • Name the key “runas” and press Enter.
  • Select the runas key.
  • Double-click the “Default” string and set its value to Command Prompt (Admin).
  • Click the OK button.
  • Right-click the “runas” key (folder), select New, and choose the String Value option.
  • Name the key NoWorkingDirectory and press Enter.
  • Right-click the “runas” key (folder), select New, and choose the String Value option.
  • Name the key HasLUAShield and press Enter.
  • Right-click the “runas” key (folder), select New, and choose the String Value option.
  • Name the key Top and press Enter.
  • Double-click the newly created key and change its value to Top.
  • Click the OK button.
  • Right-click the “runas” key (folder), select New, and choose the String Value option.
  • Name the key Icon and press Enter.
  • Double-click the newly created key and change its value to C:\Windows\System32\cmd.exe.
  • Click the OK button.
  • Right-click the “runas” key (folder), select New, and choose the Key option.
  • Name the key command and press Enter.
  • Double-click the Default string and set its value to cmd.exe /s /k pushd "%V".
  • Click the OK button.
  • Restart the computer.

Once you complete the steps, use the Shift + F10 keyboard shortcut or right-click inside of a folder and choose the Show more options item to open the classic context menu to find the option to open the path in Command Prompt, but with the admin console.

Open Start on Windows 11.

Search for regedit and click the top result to open the app.

Navigate to the following path:

HKEY_CLASSES_ROOT\Directory\Background\shell

Right-click the “shell” key (folder), select New, and choose the Key option.

Name the key “runas” and press Enter.

Select the runas key.

Double-click the “Default” string and set its value to Command Prompt (Admin).

Click the OK button.

Right-click the “runas” key (folder), select New, and choose the String Value option.

Name the key NoWorkingDirectory and press Enter.

Name the key HasLUAShield and press Enter.

Name the key Top and press Enter.

Double-click the newly created key and change its value to Top.

Name the key Icon and press Enter.

Double-click the newly created key and change its value to C:\Windows\System32\cmd.exe.

Right-click the “runas” key (folder), select New, and choose the Key option.

Name the key command and press Enter.

Double-click the Default string and set its value to cmd.exe /s /k pushd "%V".

Restart the computer.