本帖最后由 king1027 于 2025-5-27 23:35 编辑
现在网上的EmEditor绿色版,都没有附带EmEditor右键菜单管理工具。而且EmEditor这软件除非通过官方安装包安装,否则绿色版是无法在软件设置中添加右键上下文菜单,十分离谱。
但EmEditor的右键菜单却是一个使用频率非常高的功能,并且“在文件夹中搜索”这个功能我也很需要。
所以花了两个小时时间,从注册表中找出来EmEditor修改的注册表,然后做成了添加和删除右键菜单的批处理文件,分享给大家。自己复制代码另存为批处理文件(需为gb2312字符集文件)后即可使用。
添加右键菜单批处理(需放到EmEditor程序所在目录运行):
[PowerShell] 纯文本查看 复制代码
@rem 将此批处理文件放到Emeditor.exe所在目录运行
@set emeditor_path=%~dp0
@REM 此行命令无效 set /p emeditor_path=输入EmEditor.exe所在目录:
@REM 添加空白处右键菜单
reg add HKCR\Directory\Background\shell\EmEditor /t REG_SZ /d "用 EmEditor 在文件中查找" /f
reg add HKCR\Directory\Background\shell\EmEditor /v "Icon" /t REG_SZ /d "%emeditor_path%\emedres.dll,-128" /f
reg add HKCR\Directory\Background\shell\EmEditor\command /t REG_SZ /d "\"%emeditor_path%\emeditor.exe\" /fd %V" /f
reg add HKCU\SOFTWARE\Classes\Directory\Background\shell\EmEditor /t REG_SZ /d "用 EmEditor 在文件中查找" /f
reg add HKCU\SOFTWARE\Classes\Directory\Background\shell\EmEditor /v "Icon" /t REG_SZ /d "%emeditor_path%\emedres.dll,-128" /f
reg add HKCU\SOFTWARE\Classes\Directory\Background\shell\EmEditor\command /t REG_SZ /d "\"%emeditor_path%\emeditor.exe\" /fd %V" /f
@REM 添加目录右键菜单
reg add HKCR\Directory\Directory\shell\EmEditor /t REG_SZ /d "用 EmEditor 在文件中查找" /f
reg add HKCR\Directory\Directory\shell\EmEditor /v "Icon" /t REG_SZ /d "%emeditor_path%\emedres.dll,-128" /f
reg add HKCR\Directory\Directory\shell\EmEditor\command /t REG_SZ /d "\"%emeditor_path%\emeditor.exe\" /fd %%1" /f
reg add HKCU\SOFTWARE\Classes\Directory\shell\EmEditor /t REG_SZ /d "用 EmEditor 在文件中查找" /f
reg add HKCU\SOFTWARE\Classes\Directory\shell\EmEditor /v "Icon" /t REG_SZ /d "%emeditor_path%\emedres.dll,-128" /f
reg add HKCU\SOFTWARE\Classes\Directory\shell\EmEditor\command /t REG_SZ /d "\"%emeditor_path%\emeditor.exe\" /fd %%1" /f
@REM 添加盘符右键菜单
reg add HKCR\Drive\shell\EmEditor /t REG_SZ /d "用 EmEditor 在文件中查找" /f
reg add HKCR\Drive\shell\EmEditor /v "Icon" /t REG_SZ /d "%emeditor_path%\emedres.dll,-128" /f
reg add HKCR\Drive\shell\EmEditor\command /t REG_SZ /d "\"%emeditor_path%\emeditor.exe\" /fd %V" /f
reg add HKCU\SOFTWARE\Classes\Drive\shell\EmEditor /t REG_SZ /d "用 EmEditor 在文件中查找" /f
reg add HKCU\SOFTWARE\Classes\Drive\shell\EmEditor /v "Icon" /t REG_SZ /d "%emeditor_path%\emedres.dll,-128" /f
reg add HKCU\SOFTWARE\Classes\Drive\shell\EmEditor\command /t REG_SZ /d "\"%emeditor_path%\emeditor.exe\" /fd %V" /f
@REM 添加文件右键菜单
reg add HKCR\*\shell\EmEditor /v "Icon" /t REG_SZ /d "%emeditor_path%\emedres.dll,-128" /f
reg add HKCR\*\shell\EmEditor\command /t REG_SZ /d "\"%emeditor_path%\emeditor.exe\" \"%%1\"" /f
reg add HKCR\SOFTWARE\Classes\*\shell\EmEditor /v "Icon" /t REG_SZ /d "%emeditor_path%\emedres.dll,-128" /f
reg add HKCR\SOFTWARE\Classes\*\shell\EmEditor\command /t REG_SZ /d "\"%emeditor_path%\emeditor.exe\" \"%%1\"" /f
删除右键菜单批处理(任意位置皆可运行):
[PowerShell] 纯文本查看 复制代码 @REM 此批处理文件可在任意位置执行
@REM 删除空白处右键菜单
reg delete HKCR\Directory\Background\shell\EmEditor /f
reg delete HKCU\SOFTWARE\Classes\Directory\Background\shell\EmEditor /f
@REM 删除目录右键菜单
reg delete HKCR\Directory\Directory\shell\EmEditor /f
reg delete HKCU\SOFTWARE\Classes\Directory\shell\EmEditor /f
@REM 删除盘符右键菜单
reg delete HKCR\Drive\shell\EmEditor /f
reg delete HKCU\SOFTWARE\Classes\Drive\shell\EmEditor /f
@REM 删除文件夹右键菜单
reg delete HKCR\*\shell\EmEditor /f
reg delete HKCR\SOFTWARE\Classes\*\shell\EmEditor /f |