搜索
查看: 1488|回复: 0

windows添加右键打开cmd和Powershell窗口

[复制链接]

75

主题

107

帖子

199

积分

注册会员

Rank: 2

积分
199
发表于 2020-6-5 21:20:42 | 显示全部楼层 |阅读模式

使用

鼠标右键: 在此处打开命令行窗口 在此处打开命令行窗口(管理员) shift + 鼠标右键:

在此处打开 Powershell 窗口 在此处打开 Powershell 窗口(管理员)

代码

新建 xx.reg,输入以下代码

Windows Registry Editor Version 5.00
[-HKEY_CLASSES_ROOT\Directory\Background\shell\OpenCmdHere]
[-HKEY_CLASSES_ROOT\Directory\Background\shell\runas]
[-HKEY_CLASSES_ROOT\Directory\Background\shell\PowershellAdmin]

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

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

; 2.右键:命令行(管理员)
[HKEY_CLASSES_ROOT\Directory\Background\shell\runas]
@="在此处打开命令行窗口(管理员)"
"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"
"在此处打开命令行窗口"

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

; 2.右键:命令行(管理员)
[HKEY_CLASSES_ROOT\Directory\Background\shell\runas]
@="在此处打开命令行窗口(管理员)"
"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"


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

; 2.右键:命令行(管理员)
[HKEY_CLASSES_ROOT\Directory\Background\shell\runas]
@="在此处打开命令行窗口(管理员)"
"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"
command]
@="cmd.exe -noexit -command Set-Location -literalPath \"%V\"" 

; 2.右键:命令行(管理员)
[HKEY_CLASSES_ROOT\Directory\Background\shell\runas]
@="在此处打开命令行窗口(管理员)"
"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"
]
@="cmd.exe -noexit -command Set-Location -literalPath \"%V\"" 

; 2.右键:命令行(管理员)
[HKEY_CLASSES_ROOT\Directory\Background\shell\runas]
@="在此处打开命令行窗口(管理员)"
"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"
"cmd.exe -noexit -command Set-Location -literalPath \"%V\"" 

; 2.右键:命令行(管理员)
[HKEY_CLASSES_ROOT\Directory\Background\shell\runas]
@="在此处打开命令行窗口(管理员)"
"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"


; 2.右键:命令行(管理员)
[HKEY_CLASSES_ROOT\Directory\Background\shell\runas]
@="在此处打开命令行窗口(管理员)"
"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"
"在此处打开命令行窗口(管理员)"
"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"

"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"
"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"
=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"
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"
]
@="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"
"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"


; 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"
"在此处打开 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"

"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"
"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"
=""

[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"
""

[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"


[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"
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"
]
@="\"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"
"\"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"
专业装逼!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

温馨提示
1:发帖请遵守《中华人民共和国网络安全法》,发帖内容不得维护国家的、集体的、个人的利益。
2:请勿发布恶意攻击他人的技术文章、工具、和使用教程,发现后删帖处理。
3:本站的目的在于让更多的人了解网络安全,避免受到他人的恶意攻击。
4:本站中的部分文章,可能会出现一些“技术类手段”,但这仅仅为学习演示所用,而非恶意传播技术。
5:本站中的部分文章,可能转载自互联网。如有侵权行为,联系我们删除即可。
6:学习仅是充实头脑,切勿恶意攻击个人、企业等。所造成的法律后果一切由自己承担,本站及其站长概不负责。
我知道了
快速回复 返回顶部 返回列表