Win10添加右键在此处打开命令行
其实一般有一个快捷的办法,就是在需要定位的文件夹的空白处按住shift
+ 鼠标右键,就会有一个选项 ——在此处打开命令窗口
具体步骤
第一步:新建一个txt文件,命名为OpenCmdHere.txt,注意设置编码格式为ANSI
第二步:在文件中输入如下代码,并保存
原始版本:
这种是先调用powershell,通过powershell打开cmd
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\""
新版:
Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\Directory\shell\OpenCmdHere] @="在此处打开命令窗口" "Icon"="cmd.exe" [HKEY_CLASSES_ROOT\Directory\shell\OpenCmdHere\command] @="cmd.exe /s /k pushd \"%V\"" [HKEY_CLASSES_ROOT\Directory\Background\shell\OpenCmdHere] @="在此处打开命令窗口" "Icon"="cmd.exe" [HKEY_CLASSES_ROOT\Directory\Background\shell\OpenCmdHere\command] @="cmd.exe /s /k pushd \"%V\"" [HKEY_CLASSES_ROOT\Drive\shell\OpenCmdHere] @="在此处打开命令窗口" "Icon"="cmd.exe" [HKEY_CLASSES_ROOT\Drive\shell\OpenCmdHere\command] @="cmd.exe /s /k pushd \"%V\"" [HKEY_CLASSES_ROOT\LibraryFolder\background\shell\OpenCmdHere] @="在此处打开命令窗口" "Icon"="cmd.exe" [HKEY_CLASSES_ROOT\LibraryFolder\background\shell\OpenCmdHere\command] @="cmd.exe /s /k pushd \"%V\""
第三步:更改文件后缀名为reg,弹出的提示点确认。
第四步:双击OpenCmdHere.reg文件运行,弹出的提示点确认,修改注册表就大功告成了!