iSumsoft » Resources »Windows 10»Open Command Prompt as Administrator from Context Menu

How to Open Command Prompt as Administrator from Context Menu

Isabella Shinn
Isabella Shinn

Updated:

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.

Open the Notepad in Windows 10

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.

Save Command Prompt Admin reg file

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

Merge registry entries

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

Add cmd registry entry

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

Open Command Prompt Admin from context menu