A-A+

Win10添加右键打开cmd和Powershell窗口(管理员/非管理员)

2019年07月03日 17:40 汪洋大海 暂无评论 共1064字 (阅读2,658 views次)

代码如下,Windows直接新建txt,粘贴进去保存,然后选择另存为,保存类型选所有文件、编码选ANSI、文件名为CmdAndPowershellAll.reg(名字无所谓,后缀为.reg就可以)。双击打开,会进行两次确认,然后会提示“已成功添加到注册表中”,这样就成功了!现在可以右键、shift+右键尝试一下了!

 

Windows Registry Editor Version 5.00

; 1.右键:命令行
[HKEY_CLASSES_ROOT\Directory\Background\shell\OpenCmdHere]
@="打开cmd窗口"

[HKEY_CLASSES_ROOT\Directory\Background\shell\OpenCmdHere\command]
@="cmd.exe -noexit -command Set-Location -literalPath \"%V\"" 

; 2.右键:命令行(管理员)
[HKEY_CLASSES_ROOT\Directory\Background\shell\runas]
@="打开cmd窗口(管理员)"
"ShowBasedOnVelocityId"=dword:00639bc8

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

; 3.shift+右键:Powershell(管理员)
[HKEY_CLASSES_ROOT\Directory\Background\shell\PowershellAdmin]
@="打开 Powershell 窗口(管理员)"
"Extended"=""

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

文章来源:https://blog.csdn.net/cxrsdn/article/details/84538767

布施恩德可便相知重

微信扫一扫打赏

支付宝扫一扫打赏

×

给我留言