Windows10右键菜单实现CMD运行命令的操作方法

第一种方【fāng】法:将下面内容【róng】粘贴【tiē】到该文本文档中,保存。并将该文本【běn】文档以.reg结尾即可,名字【zì】可【kě】以随【suí】意【yì】取。(@=”此处打开命令行” 该引号内文字可以随意修改成你想要显示的文字)

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINESOFTWAREClassesDirectorybackgroundshellcmd_here]

@="CMD.exe"
"Icon"="cmd.exe"

[HKEY_LOCAL_MACHINESOFTWAREClassesDirectorybackgroundshellcmd_herecommand]

@=""C:\Windows\System32\cmd.exe""

[HKEY_LOCAL_MACHINESOFTWAREClassesFoldershellcmdPrompt]

@="CMD.exe"

[HKEY_LOCAL_MACHINESOFTWAREClassesFoldershellcmdPromptcommand]

@=""C:\Windows\System32\cmd.exe" "cd %1""

[HKEY_LOCAL_MACHINESOFTWAREClassesDirectoryshellcmd_here]

@="CMD.exe"
"Icon"="cmd.exe"

[HKEY_LOCAL_MACHINESOFTWAREClassesDirectoryshellcmd_herecommand]

@=""C:\Windows\System32\cmd.exe""

第二种方法:有时候需要在指定目录打开CMD,添加右键菜单后,直接运行就是在该目录下,不用再用cd命令进入。
新建文件【jiàn】,写入下面内【nèi】容,存【cún】为CMD.reg,双击该文件可自动导入设【shè】置。

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOTDirectoryBackgroundshellOpenCMD]
"ShowBasedOnVelocityId"=dword:00639bc8

[HKEY_CLASSES_ROOTDirectoryBackgroundshellOpenCMDcommand]
@="cmd.exe /s /k pushd "%V""

备注:如果不小心注册,需要删除注册表,每个注册表HKEY导入项前面加一个” – ” ,例如:

Windows Registry Editor Version 5.00

[-HKEY_CLASSES_ROOTDirectoryBackgroundshellOpenCMD]
"ShowBasedOnVelocityId"=dword:00639bc8

[-HKEY_CLASSES_ROOTDirectoryBackgroundshellOpenCMDcommand]
@="cmd.exe /s /k pushd "%V""
阿里企业邮箱、网易企业邮箱、新网企业邮箱
【标准版】400元/年/5用户/无限容量
【外贸版】500元/年/5用户/无限容量
其它服务:网【wǎng】站【zhàn】建设、企业邮箱、数字【zì】证书【shū】ssl、400电话、
联系方式:电话:13714666846 微信同号

声明:本站【zhàn】所有作品(图【tú】文、音视频)均【jun1】由用户【hù】自行上【shàng】传分【fèn】享,或互联网相关知识整合,仅供网友学习交流,若您的权利【lì】被侵害【hài】,请联系 管【guǎn】理【lǐ】员 删除。

本【běn】文链【liàn】接:https://www.city96.com/article_32658.html