1.首先打開注冊表
- Win + R
- 輸入regedit,回車
2.找到路徑
HKEY_CLASSES_ROOT\Directory\shell\OpenCmd\command(可以直接復制粘貼到注冊表編輯器上面的地址欄)
3.新建項
在shell目錄下新建一個名為OpenCmd的項
再在OpenCmd目錄下新建一個名為command的項
4.更改值
新建一個DWORD32類型叫ShowBasedOnVelocityId的項目,填入值639bc8
在command里面,右鍵"默認",填入cmd.exe /s /k pushd "%V"
5.通過編寫.reg文件的方式
新建一個記事本,輸入以下代碼,然后將后綴改為reg,雙擊運行,即可。
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\Background\shell\OpenCmdHere]
@="在此處打開命令行窗口"
"Extended"=""
"NoaWorkingDirectory"=""
[HKEY_CLASSES_ROOT\Directory\Background\shell\OpenCmdHere\command]
@="PowerShell -windowstyle hidden -Command \"Start-Process cmd.exe -ArgumentList '/s,/k, pushd,%V' -Verb RunAs\""
6.結語
然后就可以找個地方右鍵試試看了。
7.參考
https://blog.csdn.net/hiudawn/article/details/80701935
https://blog.csdn.net/qq_31475993/article/details/107962270
https://blog.csdn.net/cxrsdn/article/details/84538767