Fat*_*rey 1 windows powershell runas cmd.exe
我想要从 Windows 的驱动器和目录上下文菜单中以管理员身份打开命令窗口或 Powershell 窗口的选项。
我可以有两种通过创建和填充如下所示的特殊的“运行方式”的注册表项,但有一个方法可以让我有两个上下文菜单上列出,并有两个以管理员身份运行?
[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]
...
Run Code Online (Sandbox Code Playgroud)
下一个注册表黑客适用于 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"=""
Run Code Online (Sandbox Code Playgroud)
您也可以在 下为驱动器添加类似项runas
和runasPowerShell
子项[HKEY_CLASSES_ROOT\Drive\shell]
。
归档时间: |
|
查看次数: |
967 次 |
最近记录: |