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_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.
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.