为win右键菜单添加控制台入口

新建bat文件,编码格式为utf-8内容如下

 1 echo off
 2 chcp 65001
 3 reg add "HKEY_CLASSES_ROOT\*\shell\rcmd" /ve /d 控制台 /f
 4 reg add "HKEY_CLASSES_ROOT\*\shell\rcmd" /v "Icon" /d "cmd.exe" /t "REG_SZ" /f
 5 reg add "HKEY_CLASSES_ROOT\*\shell\rcmd\command" /ve /d "cmd /s /k \"pushd E:\\desktop\"" /f
 6 reg add "HKEY_CLASSES_ROOT\Folder\shell\rcmd" /ve /d 控制台 /f
 7 reg add "HKEY_CLASSES_ROOT\Folder\shell\rcmd" /v "Icon" /d "cmd.exe" /t "REG_SZ" /f
 8 reg add "HKEY_CLASSES_ROOT\Folder\shell\rcmd\command" /ve /d "cmd /s /k pushd \"%%V"" /f
 9 reg add "HKEY_CLASSES_ROOT\Directory\Background\shell\rcmd" /ve /d 控制台 /f
10 reg add "HKEY_CLASSES_ROOT\Directory\Background\shell\rcmd" /v "Icon" /d "cmd.exe" /t "REG_SZ" /f
11 reg add "HKEY_CLASSES_ROOT\Directory\Background\shell\rcmd\command" /ve /d "cmd /s /k pushd \"%%V"" /f

执行bat,邮件菜单就会出现控制台菜单项

posted @ 2022-10-09 10:16  疯狗强尼  阅读(48)  评论(0编辑  收藏  举报