增加右键菜单.REG

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\shell\OpenCMDHere]
@="@shell32.dll,-8506"
"Icon"="cmd.exe"
"Extended"=""
"NoWorkingDirectory"=""

[HKEY_CLASSES_ROOT\Directory\shell\OpenCMDHere\command]
@="cmd.exe /s /k pushd \"%V\""

[HKEY_CLASSES_ROOT\Directory\Background\shell\OpenCMDHere]
@="@shell32.dll,-8506"
"Icon"="cmd.exe"
"Extended"=""
"NoWorkingDirectory"=""

[HKEY_CLASSES_ROOT\Directory\Background\shell\OpenCMDHere\command]
@="cmd.exe /s /k pushd \"%V\""

[HKEY_CLASSES_ROOT\Drive\shell\OpenCMDHere]
@="@shell32.dll,-8506"
"Icon"="cmd.exe"
"Extended"=""
"NoWorkingDirectory"=""

[HKEY_CLASSES_ROOT\Drive\shell\OpenCMDHere\command]
@="cmd.exe /s /k pushd \"%V\""

[HKEY_CLASSES_ROOT\LibraryFolder\background\shell\OpenCMDHere]
@="@shell32.dll,-8506"
"Icon"="cmd.exe"
"Extended"=""
"NoWorkingDirectory"=""

[HKEY_CLASSES_ROOT\LibraryFolder\background\shell\OpenCMDHere\command]
@="cmd.exe /s /k pushd \"%V\""


删除右键菜单.REG

Windows Registry Editor Version 5.00

[-HKEY_CLASSES_ROOT\Directory\shell\OpenCMDHere]
[-HKEY_CLASSES_ROOT\Directory\Background\shell\OpenCMDHere]
[-HKEY_CLASSES_ROOT\Drive\shell\OpenCMDHere]
[-HKEY_CLASSES_ROOT\LibraryFolder\background\shell\OpenCMDHere]


题外话

  • @shell32.dll,-8506中文环境下对应的就是“在此处打开命令窗口(W)”,也可直接替换成自己想要的任意字符串

  • Extended项表示需要Shift+右键才会显示,去掉这一项的话,不加Shift的情况下,右键单击也会显示

  • 注意保存的编码,一般情况下系统默认是ANSI,但是如果你把系统调成UTF8的话,那么相应的保存编码也要换成UTF8