"If a worker wants to do his job well, he must first sharpen his tools." - Confucius, "The Analects of Confucius. Lu Linggong"
Front page > Software tutorial > How to Open Command Prompt as Administrator from Context Menu

How to Open Command Prompt as Administrator from Context Menu

Published on 2024-08-05
Browse:557

This article will show you how to add an Open Command Prompt here (Administrator) option to the right-click context menu for folders, Desktop and to This PC. So that you can open Command Prompt as Administrator from the context menu in Windows 10.

How to Add Open Command Window here as administrator to the context menu

To add Open command window here as administrator to the context menu for file system folders. Here's how:

Step 1: Open the Notepad in Windows 10.

Press Win R keys to bring up Run dialog, input notepad and hit Enter key.

How to Open Command Prompt as Administrator from Context Menu

Step 2: Copy the below contents to Notepad.

To add the Open Command Window Here (Administrator) option to the context menu for file system folders, use the following REG file:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\shell\runas]
@="Open Command Window Here (Administrator)"

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

To add the entry to the context menu for Desktop, use the following REG file:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\directory\Background\Shell\runas]
@="Open Command Window Here (Administrator)"

[HKEY_CLASSES_ROOT\directory\Background\Shell\runas\command]
@="cmd.exe /s /k pushd \"%V\""

To add the entry to This PC (My Computer) context menu, use the following REG file:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\runas]
@="Open Command Window Here (Administrator)"

[HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\runas\command]
@="cmd.exe"

Step 3: Save the cmd.reg file.

How to Open Command Prompt as Administrator from Context Menu

Step 4: Then right-click the REG file and choose Merge to automatically add the registry entries.

How to Open Command Prompt as Administrator from Context Menu

And then confirm the operation and you are done by clicking Yes.

How to Open Command Prompt as Administrator from Context Menu

This change will take effect immediately. Test it by right-clicking on a folder, drive or desktop.

How to Open Command Prompt as Administrator from Context Menu

Release Statement This article is reproduced at: https://www.isumsoft.com/windows-10/open-command-prompt-as-administrator-from-context-menu.html If there is any infringement, please contact [email protected] to delete it
Latest tutorial More>

Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.

Copyright© 2022 湘ICP备2022001581号-3