Guides

Add ‘Open CMD As Admin’ In Windows 11 Right-Click Menu

create-new-text-document-in-wind

The Command Prompt is a powerful tool that allows you to perform various tasks on your Windows 11 PC. Whether you are a tech-savvy user or a casual one, you might find it useful to launch the CMD with administrative rights. This way, you can execute commands that require higher privileges, such as modifying system files or changing registry settings. In this guide, we will explain how to add the Open CMD as an admin option to the right-click menu in Windows 11. This will enable you to quickly access the Command Prompt with a simple mouse click.

  • To run commands from the system32 directory, you can open the Command Prompt as an administrator from the Start menu. This will automatically set the working directory to C:\Windows\system32>. You can then execute the commands you need from there. However, this method may not always work for some tasks that require a different directory.

Command Prompt

  • Sometimes you may need to run the CMD from a different location than the default one. One way to do this is to use the Change Directory CD command. However, this is not very convenient because it can take a long time to change the location.

Change Directory CD command

  • 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.
  • A less convenient way to launch Command Prompt from a specific folder is to use the Windows Terminal app. You can open Windows Terminal from any folder by holding down the Shift key and right-clicking on a space in the folder. Then, choose Open in Windows Terminal from the context menu. However, this method has two drawbacks: it requires more steps, and it does not run Command Prompt as an administrator.

open-terminal-Add-Open-CMD-as-Ad

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

  • Right-click in an empty location on your desktop and select New > Text Document.

create-new-text-document-in-wind

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-Command-Prompt-as-Admin
  • After that, press Ctrl+S to bring up the Save dialog box.
  • Then go to Save as type and select All Files from the drop-down menu.
  • 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

  • Then hit the Save button to save the file on your desktop. Then double-click to open it.
  • You will get a Registry Editor warning dialog box, click YES to confirm it.

Registry-Editor-warning-Add-Open

  • You will now get a message notifying you that the registry has been successfully added.
  • So now just right-click in an empty location, select Show More Options and you should see “Open command prompt here as administrator”.

Open command prompt here as administrator

  • Select it and the CMD window will now launch inside that directory with administrative privileges.

To enable the option of opening CMD as an admin from the right-click menu in Windows 11, you need to follow these steps. However, if you want to undo this modification and remove this option from the context menu later, you can do so by following these instructions.

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]
    
    
    
    
  • After that, press Ctrl+S to bring up the Save dialog box.
  • Then go to Save as type and select All Files from the drop-down menu.
  • Now give this file any name of your choice and add the .reg extension at the end (such as remove_cmd_admin.reg).
  • Then hit the Save button to save the file on your desktop. Then double-click to open it.
  • If you get a Registry Editor warning dialog box, then click YES to confirm it.
  • That’s it. This should remove the “Open command prompt here as administrator” option from the context menu.

This concludes our tutorial on how to enable or disable the Run CMD as administrator option in the Windows 11 context menu. If you encounter any issues with the steps mentioned above, please feel free to leave a comment. We will try to assist you as soon as possible.

Leave a comment

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

You may also like

Samsung Smart Switch Software
Flash Tool Guides

How To Install Samsung Smart Switch Software

Samsung Smart Switch is a convenient management tool for your Samsung Galaxy device. It allows you to seamlessly transfer, copy,
Update Samsung Software Via Samsung Smart Switch
Flash Tool Guides

How To Update Samsung Firmware Via Samsung Smart Switch

Samsung Smart Switch is a highly useful program offered by Samsung, available for both PC and Mac computers. This software