鼠标右击添加管理员权限运行cmd powershell

发布时间 2023-08-25 14:27:41作者: 风中虹衣客

右键添加cmd管理员权限运行:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\Background\shell\runas]
@="Open CMD window here as Admin"
"HasLUAShield"=""

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

右键添加powershell管理员权限运行:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\Background\shell\sail_powershell]
@="Open PowerShell window here as Admin"
"icon"="powershell.exe"
"ShowBasedOnVelocityId"=dword:00639bc8

[HKEY_CLASSES_ROOT\Directory\Background\shell\sail_powershell\command]
@="powershell.exe -windowstyle hidden -Command $stpath = pwd; Start-Process PowerShell -ArgumentList \\\"-NoExit\\\", \\\"-Command Set-Location -literalPath '%V'\\\" -verb RunAs"