其实一般有一个快捷的办法,就是在需要定位的文件夹的空白处按住shift
+ 鼠标右键,就会有一个选项 ——在此处打开命令窗口
具体步骤
第一步:新建一个txt文件,命名为OpenCmdHere.txt,注意设置编码格式为ANSI
第二步:在文件中输入如下代码,并保存
原始版本:
这种是先调用powershell,通过powershell打开cmd
Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOTDirectoryshellOpenCmdHere] @="在此处打开命令窗口" "Icon"="cmd.exe" [HKEY_CLASSES_ROOTDirectoryshellOpenCmdHerecommand] @="PowerShell -windowstyle hidden -Command "Start-Process cmd.exe -ArgumentList '/s,/k, pushd,%V' -Verb RunAs"" [HKEY_CLASSES_ROOTDirectoryBackgroundshellOpenCmdHere] @="在此处打开命令窗口" "Icon"="cmd.exe" [HKEY_CLASSES_ROOTDirectoryBackgroundshellOpenCmdHerecommand] @="PowerShell -windowstyle hidden -Command "Start-Process cmd.exe -ArgumentList '/s,/k, pushd,%V' -Verb RunAs"" [HKEY_CLASSES_ROOTDriveshellOpenCmdHere] @="在此处打开命令窗口" "Icon"="cmd.exe" [HKEY_CLASSES_ROOTDriveshellOpenCmdHerecommand] @="PowerShell -windowstyle hidden -Command "Start-Process cmd.exe -ArgumentList '/s,/k, pushd,%V' -Verb RunAs"" [HKEY_CLASSES_ROOTLibraryFolderackgroundshellOpenCmdHere] @="在此处打开命令窗口" "Icon"="cmd.exe" [HKEY_CLASSES_ROOTLibraryFolderackgroundshellOpenCmdHerecommand] @="PowerShell -windowstyle hidden -Command "Start-Process cmd.exe -ArgumentList '/s,/k, pushd,%V' -Verb RunAs""
新版:
Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOTDirectoryshellOpenCmdHere] @="在此处打开命令窗口" "Icon"="cmd.exe" [HKEY_CLASSES_ROOTDirectoryshellOpenCmdHerecommand] @="cmd.exe /s /k pushd "%V"" [HKEY_CLASSES_ROOTDirectoryBackgroundshellOpenCmdHere] @="在此处打开命令窗口" "Icon"="cmd.exe" [HKEY_CLASSES_ROOTDirectoryBackgroundshellOpenCmdHerecommand] @="cmd.exe /s /k pushd "%V"" [HKEY_CLASSES_ROOTDriveshellOpenCmdHere] @="在此处打开命令窗口" "Icon"="cmd.exe" [HKEY_CLASSES_ROOTDriveshellOpenCmdHerecommand] @="cmd.exe /s /k pushd "%V"" [HKEY_CLASSES_ROOTLibraryFolderackgroundshellOpenCmdHere] @="在此处打开命令窗口" "Icon"="cmd.exe" [HKEY_CLASSES_ROOTLibraryFolderackgroundshellOpenCmdHerecommand] @="cmd.exe /s /k pushd "%V""
第三步:更改文件后缀名为reg,弹出的提示点确认。
第四步:双击OpenCmdHere.reg文件运行,弹出的提示点确认,修改注册表就大功告成了!