Win10右击添加“在此处打开命令窗口”

由于现在Win10默认右键只有Powershell,现通过以下步骤可以添加“在此处打开命令窗口”:
最终效果如下:
效果一:
右击鼠标,出现在此处打开命令窗口;
这里写图片描述
效果二:
shift+右击,出现Powershell与在此处打开命令窗口两种;
这里写图片描述

操作步骤:
桌面新建txt文档,拷贝如下代码:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\shell\OpenCmdHere]
@="在此处打开命令提示符"
"Icon"="cmd.exe"

[HKEY_CLASSES_ROOT\Directory\shell\OpenCmdHere\command]
@="PowerShell -windowstyle hidden -Command \"Start-Process cmd.exe -ArgumentList '/s,/k, pushd,%V' -Verb RunAs\""

[HKEY_CLASSES_ROOT\Directory\Background\shell\OpenCmdHere]
@="在此处打开命令窗口"
"Icon"="cmd.exe"

[HKEY_CLASSES_ROOT\Directory\Background\shell\OpenCmdHere\command]
@="PowerShell -windowstyle hidden -Command \"Start-Process cmd.exe -ArgumentList '/s,/k, pushd,%V' -Verb RunAs\""

[HKEY_CLASSES_ROOT\Drive\shell\OpenCmdHere]
@="在此处打开命令窗口"
"Icon"="cmd.exe"

[HKEY_CLASSES_ROOT\Drive\shell\OpenCmdHere\command]
@="PowerShell -windowstyle hidden -Command \"Start-Process cmd.exe -ArgumentList '/s,/k, pushd,%V' -Verb RunAs\""

[HKEY_CLASSES_ROOT\LibraryFolder\background\shell\OpenCmdHere]
@="在此处打开命令窗口"
"Icon"="cmd.exe"

[HKEY_CLASSES_ROOT\LibraryFolder\background\shell\OpenCmdHere\command]
@="PowerShell -windowstyle hidden -Command \"Start-Process cmd.exe -ArgumentList '/s,/k, pushd,%V' -Verb RunAs\""

然后将此文件另存为名为“OpenCmdHere.reg”文件,注意选择编码方式,否则更改注册表不会成功:
这里写图片描述

然后双击打开“OpenCmdHere.reg”文件,按照提示选择确认,当出现注册表修改成功的提示,即说明修改成功了。可以出现开头所说的两种效果。

  • 6
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 15
    评论
可以按照以下步骤增加桌面右键菜单: 1. 在桌面上新建一个文本文档,然后将其重命名为“添加到右键菜单.reg”,注意后缀名必须为.reg。 2. 双击打开添加到右键菜单.reg”,然后点击“是”确认添加,再点击“确定”完成添加。 3. 然后你就可以在桌面上右键点击任意文件或文件夹,就会看到新添加的菜单项。 下面是“添加到右键菜单.reg”的代码: ``` Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\Directory\Background\shell\cmd] @="在此处打开命令窗口" [HKEY_CLASSES_ROOT\Directory\Background\shell\cmd\command] @="cmd.exe /K cd %v" [HKEY_CLASSES_ROOT\Directory\Background\shell\powershell] @="在此处打开 PowerShell 窗口" [HKEY_CLASSES_ROOT\Directory\Background\shell\powershell\command] @="powershell.exe -noexit -command Set-Location -LiteralPath '%V'" [HKEY_CLASSES_ROOT\Directory\Background\shell\git-bash] @="在此处打开 Git Bash 窗口" [HKEY_CLASSES_ROOT\Directory\Background\shell\git-bash\command] @="\"C:\\Program Files\\Git\\bin\\bash.exe\" --login -i -c 'cd \"$(cygpath '%V')\" ; exec bash'" [HKEY_CLASSES_ROOT\Drive\shell\cmd] @="在此处打开命令窗口" [HKEY_CLASSES_ROOT\Drive\shell\cmd\command] @="cmd.exe /K cd %v" [HKEY_CLASSES_ROOT\Drive\shell\powershell] @="在此处打开 PowerShell 窗口" [HKEY_CLASSES_ROOT\Drive\shell\powershell\command] @="powershell.exe -noexit -command Set-Location -LiteralPath '%V'" [HKEY_CLASSES_ROOT\Drive\shell\git-bash] @="在此处打开 Git Bash 窗口" [HKEY_CLASSES_ROOT\Drive\shell\git-bash\command] @="\"C:\\Program Files\\Git\\bin\\bash.exe\" --login -i -c 'cd \"$(cygpath '%V')\" ; exec bash'" ``` 代码中包含了打开命令窗口、PowerShell 窗口和 Git Bash 窗口三个菜单项,你也可以根据自己的需求进行修改。注意修改后需要保存并双击打开修改后的.reg文件,才能使修改生效。
评论 15
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值