add admin command prompt in right context menu

How to add Command Prompt admin in Right-click context menu on Windows 11?

This article will guide you to add Command Prompt in Right-click context menu on Windows 11, using this you can open any file or folder using the elevated command prompt. For example, if you want to open any folder path in the command prompt, then you can right-click on that folder and choose Command Prompt (admin), now you will see the folder path in elevated Command Prompt. By default, you can use the file explorer address bar to open any folder path in the command prompt in Windows. Using this method, you can open the folder path in the command prompt without admin privileges. If you want to open the folder path in the elevated command prompt then you can use this method. This method will guide you to add Command Prompt admin in Right-click context menu on Windows 11.

Add Command Prompt admin in Right-click context menu:

Note: Modifying the Registry is risky, and it causes irreversible damage to your OS Installation Follow the steps correctly. Friendly advice Before Modifying Registry Creating Restore Point is recommended.

In this method we are going to add the command prompt (Admin) to the right-click context menu, so you can right-click on any folder and open that folder path in cmd admin. For this, we are going to add the registry file, follow the below-mentioned steps.

Open Notepad and copy-paste the following code.

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\background\shell\runas]
@="Admin Command Here"
"NoWorkingDirectory"=""
"HasLUAShield"=""
"Position"="Top"
"Icon"="C:\\\\Windows\\\\System32\\\\cmd.exe"

[HKEY_CLASSES_ROOT\Directory\background\shell\runas\command]
@="cmd.exe /s /k pushd \"%V\""

Now save the file as CmdAdmin.reg in any location, I saved it on the desktop.

Double-click on the file to merge, and you’ll get one confirmation pop-up, click on Yes to confirm.

Next, restart the system once and after the restart, just right-click on any folder you’ll see the Admin Command Here option.

Add Command Prompt admin in Right-click context

Click on that option to access that folder location path in cmd admin. That’s it.

Read More:

How to add Windows Terminal (Admin) to File explorer context menu in Windows 11?

1 thought on “How to add Command Prompt admin in Right-click context menu on Windows 11?”

  1. Thanks for the solution! Love my “admin terminal here” in the context menu. But you said to save the text supplied to “CmdAdmin.bat”. I believe that should be “CmdAdmin.reg”. Maybe bat works for some reason, though.

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top