Home >System Tutorial >Windows Series >How to Open Command Prompt as Administrator from Context Menu
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.
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.
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_ROOTDirectoryshellrunas]
@="Open Command Window Here (Administrator)"
[HKEY_CLASSES_ROOTDirectoryshellrunascommand]
@="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_ROOTdirectoryBackgroundShellrunas]
@="Open Command Window Here (Administrator)"
[HKEY_CLASSES_ROOTdirectoryBackgroundShellrunascommand]
@="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_ROOTCLSID{20D04FE0-3AEA-1069-A2D8-08002B30309D}shellrunas]
@="Open Command Window Here (Administrator)"
[HKEY_CLASSES_ROOTCLSID{20D04FE0-3AEA-1069-A2D8-08002B30309D}shellrunascommand]
@="cmd.exe"
Step 3: Save the cmd.reg file.
Step 4: Then right-click the REG file and choose Merge to automatically add the registry entries.
And then confirm the operation and you are done by clicking Yes.
This change will take effect immediately. Test it by right-clicking on a folder, drive or desktop.
The above is the detailed content of How to Open Command Prompt as Administrator from Context Menu. For more information, please follow other related articles on the PHP Chinese website!