欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

在右键菜单中添加“在此处打开CMD窗口“

程序员文章站 2022-07-02 20:29:11
...

新建一个文本文件,重命名为openCMD.reg
用记事本打开该文件,输入以下内容

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\*\shell\openCMD]
@="在此处打开CMD窗口"
"Icon"="cmd.exe"
"ShowBasedOnVelocityId"=dword:00639bc8
[HKEY_CLASSES_ROOT\*\shell\openCMD\command]
@="cmd.exe /s /k pushd \"%V\""

[HKEY_CLASSES_ROOT\Directory\Background\shell\openCMD]
@="在此处打开CMD窗口"
"Icon"="cmd.exe"
"ShowBasedOnVelocityId"=dword:00639bc8
[HKEY_CLASSES_ROOT\Directory\Background\shell\openCMD\command]
@="cmd.exe /s /k pushd \"%V\""

[HKEY_CLASSES_ROOT\Directory\shell\openCMD]
@="在此处打开CMD窗口"
"Icon"="cmd.exe"
"ShowBasedOnVelocityId"=dword:00639bc8
[HKEY_CLASSES_ROOT\Directory\shell\openCMD\command]
@="cmd.exe /s /k pushd \"%V\""

[HKEY_CLASSES_ROOT\Folder\shell\openCMD]
@="在此处打开CMD窗口"
"Icon"="cmd.exe"
"ShowBasedOnVelocityId"=dword:00639bc8
[HKEY_CLASSES_ROOT\Folder\shell\openCMD\command]
@="cmd.exe /s /k pushd \"%V\""

保存,注意文件编码应设置为GBK
双击该文件,确定合并到注册表,完成~
删除这些注册表项时,将该文件中的以下内容进行修改,然后重新合并到注册表即可。

修改前:

[HKEY_CLASSES_ROOT\*\shell\openCMD]
[HKEY_CLASSES_ROOT\*\shell\openCMD\command]
[HKEY_CLASSES_ROOT\Directory\Background\shell\openCMD]
[HKEY_CLASSES_ROOT\Directory\Background\shell\openCMD\command]
[HKEY_CLASSES_ROOT\Directory\shell\openCMD]
[HKEY_CLASSES_ROOT\Directory\shell\openCMD\command]
[HKEY_CLASSES_ROOT\Folder\shell\openCMD]
[HKEY_CLASSES_ROOT\Folder\shell\openCMD\command]

修改后:

[-HKEY_CLASSES_ROOT\*\shell\openCMD]
[-HKEY_CLASSES_ROOT\*\shell\openCMD\command]
[-HKEY_CLASSES_ROOT\Directory\Background\shell\openCMD]
[-HKEY_CLASSES_ROOT\Directory\Background\shell\openCMD\command]
[-HKEY_CLASSES_ROOT\Directory\shell\openCMD]
[-HKEY_CLASSES_ROOT\Directory\shell\openCMD\command]
[-HKEY_CLASSES_ROOT\Folder\shell\openCMD]
[-HKEY_CLASSES_ROOT\Folder\shell\openCMD\command]