Beyond Compare3 添加到右键菜单

Beyond Compare 是个优秀的工具,我们经常用于对比文件和文件夹,右键点点就可以调用对比,着实很方便.但从3.2版本之前,我们可以从设置中将bc关联到文件夹和文件右键,但之后的版本已经找不到此设置选项.
没有此选项每次要先打开bc,然后再选择要比较的文件或文件夹,造成一定的麻烦,也不怎么习惯.
我们可以通过手动添加注册表的方式来解决. 为方便大家,线提供组织好的批处理一份,只需将批处理保存运行即可.

重要说明:
1:首先确保bc目录下有BCShellEx.dll,或者BCShellEx64.dll,这里两个文件用于32位机器和64位机器的邮件功能,如果没有这两个文件可以在网上下载。
2:本批处理要放在BC3的目录下,然后运行此bat文件
3:运行完成后,需要再次打开BCompare.exe这个软件,点击:工具-->选项-->启动,就可以看到“在资源管理器上.....”的复选框,然后勾选上即可
4:这时在文件上点击右键,就有菜单键了。

BC3添加右键菜单.bat

@ECHO OFF
rem 请将此脚本放在BC的目录执行,例如 F:\Software\Beyond Compare

REM 将当前路径设为变量
SET BC3PATH=%~DP0
REM 创建用户配置文件,关闭初次启动程序时的设置向导
if exist "%USERPROFILE%\Application Data\Scooter Software\Beyond Compare 3" RD /q /s "%USERPROFILE%\Application Data\Scooter Software\Beyond Compare 3"
IF NOT EXIST "%USERPROFILE%\Application Data\Scooter Software\Beyond Compare 3" MD "%USERPROFILE%\Application Data\Scooter Software\Beyond Compare 3"
COPY /Y NUL "%USERPROFILE%\Application Data\Scooter Software\Beyond Compare 3\BCState.xml"
(
ECHO ^<?xml version="1.0" encoding="UTF-8"?^>
ECHO ^<!-- Produced by Beyond Compare 3 from Scooter Software --^>
ECHO ^<BCState^>
ECHO ^<TBcState^>
ECHO ^<FirstStartup Value="False"/^>
ECHO ^<FormPosStr Value="110;111;980;737"/^>
ECHO ^</TBcState^>
ECHO ^</BCState^>
) >> "%USERPROFILE%\Application Data\Scooter Software\Beyond Compare 3\BCState.xml"

REM 注册右键
reg add "HKLM\Software\Scooter Software\Beyond Compare 3" /v "ExePath" /t REG_SZ /d "%cd%\BCompare.exe" /f
rem reg add "HKLM\Software\Scooter Software\Beyond Compare 3" /v "Version" /t REG_SZ /d "3.1.7.10865" /f
reg add "HKCU\Software\Scooter Software\Beyond Compare 3" /v "ExePath" /t REG_SZ /d "%cd%\BCompare.exe" /f
rem reg add "HKCU\Software\Scooter Software\Beyond Compare 3" /v "Version" /t REG_SZ /d "3.1.7.10865" /f
reg add "HKCR\.bcpkg" /ve /t REG_SZ /d "BeyondCompare.SettingsPackage" /f
reg add "HKCR\BeyondCompare.SettingsPackage" /ve /t REG_SZ /d "Beyond Compare Settings Package" /f
reg add "HKCR\BeyondCompare.SettingsPackage\DefaultIcon" /ve /t REG_SZ /d "%cd%\BCompare.exe,0" /f
reg add "HKCR\BeyondCompare.SettingsPackage\shell\open\command" /ve /t REG_SZ /d "\"%cd%\BCompare.exe\" \"%%1\"" /f
reg add "HKCR\.bcss" /ve /t REG_SZ /d "BeyondCompare.Snapshot" /f
reg add "HKCR\BeyondCompare.Snapshot" /ve /t REG_SZ /d "Beyond Compare Snapshot" /f
reg add "HKCR\BeyondCompare.Snapshot\DefaultIcon" /ve /t REG_SZ /d "%cd%\BCompare.exe,0" /f
reg add "HKCR\BeyondCompare.Snapshot\shell\open\command" /ve /t REG_SZ /d "\"%cd%\BCompare.exe\" \"%%1\"" /f
reg add "HKLM\System\CurrentControlSet\Services\EventLog\Application\Beyond Compare 3" /v "EventMessageFile" /t REG_SZ /d "%cd%\BCompare.exe" /f
reg add "HKLM\System\CurrentControlSet\Services\EventLog\Application\Beyond Compare 3" /v "TypesSupported" /t REG_DWORD /d 7 /f

既然是绿色版本,就在给个取消注册的代码,其实就是对前面注册表的删除,请看下面的卸载的bat代码:
BC3取消右键菜单.bat

reg delete "HKLM\Software\Scooter Software" /f
reg delete "HKCU\Software\Scooter Software" /f
reg delete "HKCR\.bcpkg" /f
reg delete "HKCR\BeyondCompare.SettingsPackage" /f
reg delete "HKCR\.bcss" /ve /t REG_SZ /d "BeyondCompare.Snapshot" /f
reg delete "HKCR\BeyondCompare.Snapshot" /f
reg delete "HKLM\System\CurrentControlSet\Services\EventLog\Application\Beyond Compare 3" /f

参考出处:http://blog.chinaunix.net/uid-24118190-id-3900445.html

你可能感兴趣的:(compare)