Command Prompt with administrative rights allows users to execute the commands with full rights. Some of the command lines cannot be executed using standard Command Prompt and you need to launch elevated command prompt. If you constantly use Command Prompt with administrative privileges then you might like to add “Open command window as administrator” context menu for the quick access.

Whenever you right click on a folder, drive or background you will see “Open command window as administrator” context menu.

You need to edit your Windows Registry in order to add this particular context menu.
Note: You must be signed in as an administrator to add/remove or use “Open command window as administrator” context menu.

To Add “Open command window as administrator” Context Menu on Windows 10

  1. Type regedit on Windows search box and hit Enter key to open the Registry Editor on your Windows 10 PC.
  2. Navigate the following path in your Windows registry editor.
    HKEY_CLASSES_ROOT\Directory\shell                                                                      add open command window as administrator context menu on windows 10 
  3. Right click on the “shell”, select New and then Key option. A new key will be created. Name it as “OpenCmdAsAdmin”.                                                                                       add open command window as administrator context menu on windows 10
  4. Now right click on “OpenCmdAsAdmin”, select New and then Key option to create another key. Name it as “command”.                                                                                             add open command window as administrator context menu on windows 10
  5. After creating keys, select “OpenCmdAsAdmin” and then you need to change the default value. Double click on Default on the right pane of Registry Editor.                                      add open command window as administrator context menu on windows 10
  6. Set the value data as “Open command window as administrator” and hit OK.                       add open command window as administrator context menu on windows 10
  7. Right click on “OpenCmdAsAdmin”, select New and then click on “String value”. Name it as “Icon” and set the value as “imageres.dll,-5324”. Click OK.                                                add open command window as administrator context menu on windows 10
  8. Select Command key and edit its default value by double clicking on “Default”.                   add open command window as administrator context menu on windows 10
  9. Set the value as follows and click OK.

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

add open command window as administrator context menu on windows 10

  • You need to repeat the above given process again on different Key path.
    HKEY_CLASSES_ROOT\Directory\Background\shell
  • Perform above explained steps 3 to 9.
  • Now navigate another path
    HKEY_CLASSES_ROOT\Drive\shell
  • Perform steps 3 to 9 again.

Now you can check the context menu by right click on background, folder or drive.

add open command window as administrator context menu on windows 10

If you are not willing to perform this trick by following this lengthy and complex process, you can use another shortcut method as follows.

  • Download the zip folder which contains two .reg files. Extract the files and keep them on the desktop. One file is for adding and another for removing “Open command window as administrator” context menu.
Download
  • Double click on the specified .reg file to merge it.
  • When prompted, click on Run, Yes (UAC), Yes and OK.

Use the convenient method and quickly access Command Prompt (Admin).

Standard Warning: It is recommended not to play with Windows Registry Editor unless or until you are aware of basics of this complex structure. Windows Registry contains all the default settings of the Computer system, so misusing Registry may corrupt your Windows and make your PC unstable. So we don’t suggest a fresher to use Registry editor. If you have some knowledge and you stick to our instructions then there would be no problem but still we recommend you to take a backup of your Windows Registry as well as the data of your PC before starting any of registry editing tricks.

LEAVE A REPLY

Please enter your comment!
Please enter your name here