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


**Disclosure: This post contains affiliate links. If you make a purchase through these links, we may earn a small commission at no extra cost to you.

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.

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, as seen in the image below. 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.

Right click open in terminal

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.

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\””

 [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\””

 [HKEY_CLASSES_ROOT\LibraryFolder\background\shell\OpenElevatedCmd]

@=”Open command prompt here as administrator”

“Icon”=”cmd.exe”

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

@=

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

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

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.

UAC prompt

Next, you will need to click the Yes button when it asks if you want to continue.

Import registry file

You will then be informed that the keys and valued from the registry file have been imported into the registry and you can click the OK button to finish the process.

Import registry file

Now when you right click on a folder, you will need to click on Show more options (for Windows 11) and 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

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.

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

Now we have a command prompt window opened to the folder that we right clicked on without having to navigate to it.

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

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

Check out our extensive IT book series.

Related Posts

© 2025 Online Computer Tips
Website by Anvil Zephyr