Más de un 'Abrir xxxxx aquí como administrador'

Más de un 'Abrir xxxxx aquí como administrador'

Quiero tener la opción de abrir una ventana de Comando o una ventana de Powershell como Administrador desde los menús contextuales de la unidad y el directorio en Windows.

yo puedo tenercualquieracreando y completando las claves de registro especiales 'runas' que se muestran a continuación, pero ¿hay alguna manera de que pueda tenerambosaparece en el menú contextual y tieneambos¿ejecutar como administrador?

[HKEY_CLASSES_ROOT\Drive\shell\runas]
...
[HKEY_CLASSES_ROOT\Drive\shell\runas\command]
...
[HKEY_CLASSES_ROOT\Directory\shell\runas]
...
[HKEY_CLASSES_ROOT\Directory\shell\runas\command]
...
[HKEY_CLASSES_ROOT\Directory\Background\shell\runas]
...
[HKEY_CLASSES_ROOT\Directory\Background\shell\runas\command]
...

Respuesta1

El siguiente truco de registro funciona para directorios en Windows 8.1:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\shell\runas]
"HasLUAShield"=""
@="CMD here as administrator"

[HKEY_CLASSES_ROOT\Directory\shell\runas\command]
@="cmd.exe /S /K pushd \"%V\""
"DelegateExecute"=""

[HKEY_CLASSES_ROOT\Directory\shell\runasPowerShell]
"HasLUAShield"=""
@="PowerShell here as administrator"

[HKEY_CLASSES_ROOT\Directory\shell\runasPowerShell\command]
@="Powershell Start-Process PowerShell -verb runas -ArgumentList '-noexit', 'Push-Location -literalPath ''\"%V\"'''"
"DelegateExecute"=""

También puede agregar subclaves análogas runasy para unidades bajo el.runasPowerShell[HKEY_CLASSES_ROOT\Drive\shell]

Ejecute CMD y PowerShell con privilegios elevados

información relacionada