Add an Open Administrative Command Prompt from Here Right Click Menu Option

Last Updated on November 26, 2026

If you use your computer for more than just the basics, you have probably had the need to perform some tasks using the Windows command line. And if you have had to open or run a file that is in a folder that is several directories deep, then it can be a bit tedious typing in the entire path to that folder in the command prompt window. This wastes valuable time.

If you right click on the folder you want to access via a command prompt, you will see that you have an Open in Terminal option but what that will do is open a PowerShell window pointed to that directory. This is a nice feature but is not helpful when you need to use the Windows command prompt instead. In this article, we will be showing you how to add an Open Administrative Command Prompt from here right click menu option.

How to Add "Open Admin Command Prompt Here" to Right-Click Menu

Right click open in terminal
Right click a folder to open the path in a terminal window

Adding the Context Menu Registry Edit

1. Download the Custom Registry File

To add this open administrative command prompt from here right click menu option, we will be performing a simple registry edit. Rather than having to perform the registry edit manually, we have provided a registry file that you can import after downloading it here. This completely automates the configuration process.

2. Review the Primary Registry Code

Here is what your will see in the Admin Command Prompt Right Click.reg file if you were to open it with a text editor. This shows you what values the registry file will add to your computer.

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\shell\OpenElevatedCmd]

@=”Open Admin Command Prompt Here”

“Icon”=”cmd.exe”

[HKEY_CLASSES_ROOT\Directory\shell\OpenElevatedCmd\command]

@=”PowerShell -windowstyle hidden -Command “Start-Process cmd.exe -ArgumentList ‘/s,/k,pushd,%V’ -Verb RunAs””

3. Check the Background and Drive Keys

The file also modifies the background and drive context menus. This ensures the prompt opens correctly no matter where you click.

[HKEY_CLASSES_ROOT\Directory\Background\shell\OpenElevatedCmd]

@=”Open command prompt here as administrator”

“Icon”=”cmd.exe”

[HKEY_CLASSES_ROOT\Directory\Background\shell\OpenElevatedCmd\command]

@=”PowerShell -windowstyle hidden -Command “Start-Process cmd.exe -ArgumentList ‘/s,/k,pushd,%V’ -Verb RunAs””

[HKEY_CLASSES_ROOT\Drive\shell\OpenElevatedCmd]

@=”Open command prompt here as administrator”

“Icon”=”cmd.exe”

[HKEY_CLASSES_ROOT\Drive\shell\OpenElevatedCmd\command]

@=”PowerShell -windowstyle hidden -Command “Start-Process cmd.exe -ArgumentList ‘/s,/k,pushd,%V’ -Verb RunAs””

4. Verify the Library Folder Keys

Finally, the script injects the necessary keys for library folders. It completes the integration across the entire Windows file explorer.

[HKEY_CLASSES_ROOT\LibraryFolder\background\shell\OpenElevatedCmd]

@=”Open command prompt here as administrator”

“Icon”=”cmd.exe”

[HKEY_CLASSES_ROOT\LibraryFolder\background\shell\OpenElevatedCmd\command]

@=

5. Run the Registry File

To import the registry file into the Windows registry, simply double click the file. You will then be presented with a security prompt asking if you want to run the file. You will need to click on the Run button to continue.

Adding registry file data to Windows
Import a registry file

6. Accept the UAC Prompt

You will then have to click the Yes button for the UAC prompt. If your Windows user account does not have administrator rights, then you will need to enter the name and password for an account that does. Standard user accounts cannot modify the system registry.

UAC prompt
Click the Yes button at the UAC prompt

7. Confirm the Registry Warning

Next, you will need to click the Yes button when it asks if you want to continue. Windows always warns you before injecting new keys into the system registry. Click yes to push the changes through.

Import registry file
Click Yes button to continue the import

8. Finish the Import Process

You will then be informed that the keys and valued from the registry file have been imported into the registry. You can click the OK button to finish the process. The context menu is now fully updated

Imported registry file success
Registry file has been imported

Using the New Command Prompt Option

1. Access the New Context Menu

Now when you right click on a folder, you will need to click on Show more options for Windows 11. Then you will see the Open Admin Command Prompt Here context menu option. You can also hold down the Shift key to go right to the secondary menu or configure your computer to use the classic right click context menu, so you do not need to click on Show more options.

Add an Open Administrative Command Prompt from Here Right Click Menu Option
Open Admin Command Prompt Here right click

2. Grant Administrator Access

Since its an administrative command prompt, you will see a UAC prompt when you use this option. So once again, you will need to have an admin account or the credentials for one. Approve the prompt to launch the window.

UAC prompt
Click the Yes button

3. Start Typing Your Commands

Now we have a command prompt window opened to the folder that we right clicked on without having to navigate to it. You can immediately start typing your administrative commands. This shortcut drastically speeds up your workflow.

Command prompt window
Command prompt for the folder location

For additional training resources, check out our online IT training courses.

Check out our extensive IT book series.

Todd Simms

Todd Simms has over 15 years of experience in the IT industry specializing in Windows, networking and hardware.

Related Posts

© 2026 Online Computer Tips
Website by Anvil Zephyr