windows开发经常会在目录下打开cmd命令,系统默认是prowershell,大部分时间可以正常通用,但有时却又问题,不兼容cmd,导致报错,开始以为是程序的问题,实际上是命令程序在prowershell不兼容导致的。
执行下面脚本就可以在win10右键菜单添加在此处打开命令cmd
将下面脚本写在 a.reg中,注意保存文件编码改为Gb2312,否则新加菜单项会乱码。
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOTDirectoryshellOpenCmdHere]
@="在此处打开命令提示符"
"Icon"="cmd.exe"
[HKEY_CLASSES_ROOTDirectoryshellOpenCmdHerecommand]
@="cmd.exe /s /k pushd "%V""
[HKEY_CLASSES_ROOTDirectoryBackgroundshellOpenCmdHere]
@="在此处打开命令窗口"
"Icon"="cmd.exe"
[HKEY_CLASSES_ROOTDirectoryBackgroundshellOpenCmdHerecommand]
@="cmd.exe /s /k pushd "%V""
[HKEY_CLASSES_ROOTDriveshellOpenCmdHere]
@="在此处打开命令窗口"
"Icon"="cmd.exe"
[HKEY_CLASSES_ROOTDriveshellOpenCmdHerecommand]
@="cmd.exe /s /k pushd "%V""
[HKEY_CLASSES_ROOTLibraryFolderackgroundshellOpenCmdHere]
@="在此处打开命令窗口"
"Icon"="cmd.exe"
[HKEY_CLASSES_ROOTLibraryFolderackgroundshellOpenCmdHerecommand]
@="cmd.exe /s /k pushd "%V""