Open Command Prompt with Administrator Privileges Anywhere

Posted by

Make an Open Command Window Here with admin privileges option.

-> You can open a new Command Prompt window directly to a folder location by right-clicking the folder in Windows while holding the Shift key and then selecting Open Command Window Here. But this opens it to user-level privileges. However, you can add a shortcut to the right-click context menu that opens it with administrator privileges.

Open Notepad, insert the following text, and save as AddToOpenAsAdmin.reg:

Windows Registry Editor Version 5.00
[-HKEY_CLASSES_ROOT\Directory\shell\runas]
[HKEY_CLASSES_ROOT\Directory\shell\runas]
@=”Open Command Window Here as Administrator”
“Icon”=”C:\\Windows\\System32\\imageres.dll,-78″
[-HKEY_CLASSES_ROOT\Directory\shell\runas\command]
[HKEY_CLASSES_ROOT\Directory\shell\runas\command]
@=”cmd.exe /s /k pushd \”%V\””

Then to apply, execute the AddToOpenAsAdmin.reg file. Now you’ll see an admin option when right-clicking a folder while holding down Shift.

Posted by Shubham ;)

 

9 comments

  1. I couldn’t get this to work, it told me it’s the incorrect format to put into the registry or something like that. HELP!!!

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.