Windows中添加右鍵菜單"在命令行中打開目錄"

有時候常常要在windows中獲得命令行打開某個目錄, 一般作法是先打開cmd而後鍵入命令cd /d切換目錄比較麻煩。shell

將如下內容保存到桌面addcmdtodir.reg文件中, 而後雙擊合併到註冊表中windows

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\Background\shell\openInCmd]
@="在命令行打開目錄"
"Icon"="C:\\WINDOWS\\system32\\cmd.exe"

[HKEY_CLASSES_ROOT\Directory\Background\shell\openInCmd\command]
@="cmd /k cd /c \"%V\""

[HKEY_CLASSES_ROOT\Directory\shell\openInCmd]
@="在命令行打開目錄"
"Icon"="C:\\WINDOWS\\system32\\cmd.exe"

[HKEY_CLASSES_ROOT\Directory\shell\openInCmd\command]
@="cmd /k cd /c \"%V\""

這時候右鍵單擊資源管理器的目錄或者目錄背景就有一個能夠直接在cmd中cd到這個目錄的菜單。
image.pngspa

相關文章
相關標籤/搜索