Home > Windows

Add ‘Open CMD as Admin’ in Windows 11 Right-Click Menu

In this guide, we will show you the steps to add the Open CMD as an admin option in the Windows 11 right-click menu. This command-line utility tool from the Redmond giants is among the most useful apps, both for the tech enthusiast and the everyday users alike. You could easily carry out most of the tasks right by executing a few handy tweaks from the Command Prompt window itself. And in most of these cases, you might need to launch the CMD window with administrative privileges.

  • One way to do so is to head over to the Start menu, search Command Prompt and then launch it as an admin. This will then pick up the C:\Windows\system32> directory and you may start off with the desired task. However, not every time will you find yourself working inside that system32 directory.
    Add Open CMD as Admin in Windows 11 Right-Click Menu
  • There exist a few instances when you would want to invoke the CMD inside any other location. In this regard, one approach is to use the Change Directory CD command. While this is a viable approach but not the most feasible one as it takes ages to change the location.
    Add Open CMD as Admin in Windows 11 Right-Click Menu
  • Then the next course of action is to head over to that folder’s address bar, type in CMD, and hit Enter. This will launch the Command Prompt Window picking up that folder’s location itself. However, it wouldn’t be in an elevated mode.
    Add Open CMD as Admin in Windows 11 Right-Click Menu
  • Then the fourth course of action is to press the Shift key and while doing so right-click in an empty location inside the folder of your choice. Then select Open in Windows Terminal and switch over to Comand Prompt. However, not only does this method requires more effort, but it doesn’t open with administrative level privileges either.
    Add Open CMD as Admin in Windows 11 Right-Click Menu

So owing to all these issues, I did a little bit of exploration and found out that you could add the Open CMD as an admin option in the Windows 11 right-click menu. After that, you just need to right-click inside any folder of your choice and select the “Open command prompt here as administrator” option. This will launch the CMD window inside that folder with elevated privileges and you may then execute the desired commands! So without any further ado, let’s check out this could be carried out.

Add Open CMD as Admin in Windows 11 Right-Click Menu

How to Add ‘Open CMD as Admin’ in Windows 11 Right-Click Menu

  1. Right-click in an empty location on your desktop and select New > Text Document.
    How to Restart File Explorer in Windows 11
  2. Then copy-paste the below command inside this Notepad file [you could also copy the commands in RAW form from here]:
    Windows Registry Editor Version 5.00
    
    [HKEY_CLASSES_ROOT\Directory\shell\OpenElevatedCmd]
    @="Open command prompt here as administrator"
    "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]
    @=

    Add Open CMD as Admin in Windows 11 Right-Click Menu

  3. After that, press Ctrl+S to bring up the Save dialog box.
  4. Then go to Save as type and select All Files from the drop-down menu.
  5. Now give this file any name of your choice and add the .reg extension at the end (such as add_cmd_admin.reg).
    Add Open CMD as Admin in Windows 11 Right-Click Menu
  6. Then hit the Save button to save the file on your desktop. Then double click to open it.
  7. You will get a Registry Editor warning dialog box, click YES to confirm it.
    Add Open CMD as Admin in Windows 11 Right-Click Menu
  8. You will now get a message notifying you that the registry has been successfully added.
    Add Open CMD as Admin in Windows 11 Right-Click Menu
  9. So now just right-click in an empty location, select Show More Options and you should see “Open command prompt here as administrator”.
    Add Open CMD as Admin in Windows 11 Right-Click Menu
  10. Select it and the CMD window will now launch inside that directory with administrative privileges.

So these were the steps to add the Open CMD as an admin option in the Windows 11 right-click menu. If at any point in time you wish to revert the changes and remove this option from the context menu, then here’s what you need to do.

How to Remove ‘Open CMD as Admin’ from Windows 11 Right Click Menu

  1. Right-click in an empty location on your desktop and select New > Text Document.
  2. Then copy-paste the below command inside this Notepad file:
    Windows Registry Editor Version 5.00
    
    [-HKEY_CLASSES_ROOT\Directory\shell\OpenCmdHereAsAdmin]
    [-HKEY_CLASSES_ROOT\Directory\Background\shell\OpenCmdHereAsAdmin]
    [-HKEY_CLASSES_ROOT\Drive\shell\OpenCmdHereAsAdmin]
    [-HKEY_CLASSES_ROOT\LibraryFolder\background\shell\OpenCmdHereAsAdmin]
    [-HKEY_CLASSES_ROOT\LibraryFolder\background\shell\OpenCmdHereAsAdmin\command]

    Add Open CMD as Admin in Windows 11 Right-Click Menu

  3. After that, press Ctrl+S to bring up the Save dialog box.
  4. Then go to Save as type and select All Files from the drop-down menu.
  5. Now give this file any name of your choice and add the .reg extension at the end (such as remove_cmd_admin.reg).
    Add Open CMD as Admin in Windows 11 Right-Click Menu
  6. Then hit the Save button to save the file on your desktop. Then double click to open it.
  7. If you get a Registry Editor warning dialog box, then click YES to confirm it.
  8. That’s it. This should remove the “Open command prompt here as administrator” option from the context menu.

With this, we round off the guide on how you could add or remove the Open CMD as an admin option in the Windows 11 right-click menu. If you have any queries concerning the aforementioned steps, do let us know in the comments. We will get back to you with a solution at the earliest.


Share:
  • The remove command doesnt work. The option is still in context menu