Easiest way to get right-click "Open command window here" with admin priveleges in Windows 7

Solution 1:

This is one of my favorites, It also takes a bit of work.

1.- Create a file.txt

Windows Registry Editor Version 5.00

[-HKEY_CLASSES_ROOT\Directory\shell\runas]

[HKEY_CLASSES_ROOT\Directory\shell\runas]
@="ElevatedCMD"
"HasLUAShield"=""

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

[-HKEY_CLASSES_ROOT\Directory\Background\shell\runas]

[HKEY_CLASSES_ROOT\Directory\Background\shell\runas]
@="ElevatedCMD"
"HasLUAShield"=""

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

[-HKEY_CLASSES_ROOT\Drive\shell\runas]

[HKEY_CLASSES_ROOT\Drive\shell\runas]
@="ElevatedCMD"
"HasLUAShield"=""

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

[HKEY_CLASSES_ROOT\LibraryFolder\background\shell]
@="none"

[HKEY_CLASSES_ROOT\LibraryFolder\background\shell\runas]
@="ElevatedCMD"
"HasLUAShield"=""

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

2.- Rename the file.txt to file.reg

3.- Click in file.reg

It'll create a regular right click context menu for most if not all possible menus.

4.- Accept confirm authorization about it.

5.- Enjoiy it

Note: Change the text "ElevatedCMD" to whatever you want, this text will be displayed to execute the CMD, and if you added it and wants to change the text, only search in regedit, open it with Windows+R and type regedit and Enter, the regedit will open, search "ElevatedCMD" with ctrl+B(Finder) and F3(Next) and edit any concurrency.

Solution 2:

The easiest way I know of is to simply install CmdOpen. I know you're trying to avoid installing something, but this is a 46 KB install, and the shell extensions themselves are less than 20 KB each (1 for 32-bit, 1 for 64-bit). It's also got some other useful features that you're not going to get out of the box.

It's certainly easier than struggling with registry edits -- especially if you're having problems.

Solution 3:

I solved it adding this registry keys:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\Background\shell\openCmdHereAsAdmin]
@="Open command prompt here as admin"

[HKEY_CLASSES_ROOT\Directory\Background\shell\openCmdHereAsAdmin\command]
@="C:\\WINDOWS\\system32\\WindowsPowerShell\\v1.0\\powershell.exe -Command \"Start-Process cmd -ArgumentList '/s,/k,pushd,%V' -Verb RunAs\""

Save it on a .reg file and double click on the file to install it on your registry.