beyond compare添加右键比较功能

  • Post author:
  • Post category:其他


编写一个添加右键批处理脚本:

@ECHO OFF & CD /D "%~DP0" & TITLE 添加右键 www.ddooo.com
>NUL 2>&1 REG.exe query "HKU\S-1-5-19" || (
    ECHO SET UAC = CreateObject^("Shell.Application"^) > "%TEMP%\Getadmin.vbs"
    ECHO UAC.ShellExecute "%~f0", "%1", "", "runas", 1 >> "%TEMP%\Getadmin.vbs"
    "%TEMP%\Getadmin.vbs"
    DEL /f /q "%TEMP%\Getadmin.vbs" 2>NUL
    Exit /b
)

reg add "HKCU\Software\Scooter Software\Beyond Compare" /f /v ExePath /d "\"%CD%\BCompare.exe\"" >NUL
reg add "HKCU\SOFTWARE\Scooter Software\Beyond Compare 4" /f /v ExePath /d "\"%CD%\BCompare.exe\"" >NUL
reg add "HKCU\SOFTWARE\Scooter Software\Beyond Compare 4\BcShellEx" /f /v SavedLeft /d "\"%CD%\BCompare.exe\"" >NUL
reg add "HKLM\SOFTWARE\WOW6432Node\Scooter Software\Beyond Compare" /f /v ExePath /d "\"%CD%\BCompare.exe\"" >NUL
reg add "HKLM\SOFTWARE\WOW6432Node\Scooter Software\Beyond Compare 4" /f /v ExePath /d "\"%CD%\BCompare.exe\"" >NUL
reg add "HKLM\SOFTWARE\WOW6432Node\Scooter Software\Beyond Compare 4\BcShellEx" /f /v SavedLeft /d "\"%CD%\BCompare.exe\"" >NUL

reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\BCompare.exe" /f /ve /d "\"%CD%\BCompare.exe\"" >NUL
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\BCompare.exe" /f /v UseURL /t REG_DWORD /d "1" >NUL 

reg add "HKLM\SOFTWARE\Classes\.bcss" /f /ve /d "BeyondCompare.Snapshot" >NUL
reg add "HKLM\SOFTWARE\Classes\BeyondCompare.Snapshot" /f /ve /d "Beyond Compare Snapshot" >NUL
reg add "HKLM\SOFTWARE\Classes\BeyondCompare.Snapshot\DefaultIcon" /f /ve /d "\"%CD%\BCompare.exe,0\"" >NUL
reg add "HKLM\SOFTWARE\Classes\BeyondCompare.Snapshot\shell\open\command" /f /ve /d "\"%CD%\BCompare.exe\" \"%%1\"" >NUL

reg add "HKLM\SOFTWARE\Classes\.bcpkg" /f /ve /d "BeyondCompare.SettingsPackage" >NUL
reg add "HKLM\SOFTWARE\Classes\BeyondCompare.SettingsPackage" /f /ve /d "Beyond Compare Settings Package" >NUL
reg add "HKLM\SOFTWARE\Classes\BeyondCompare.SettingsPackage" /f /v EditFlags /t REG_DWORD /d "0x00100000" >NUL
reg add "HKLM\SOFTWARE\Classes\BeyondCompare.SettingsPackage\DefaultIcon" /f /ve /d "\"%CD%\BCompare.exe,0\"" >NUL
reg add "HKLM\SOFTWARE\Classes\BeyondCompare.SettingsPackage\shell\open\command" /f /ve /d "\"%CD%\BCompare.exe\" \"%%1\"" >NUL

reg add "HKLM\SOFTWARE\Classes\CLSID\{57FA2D12-D22D-490A-805A-5CB48E84F12A}" /f /ve /d "CirrusShellEx" >NUL
reg add "HKLM\SOFTWARE\Classes\CLSID\{57FA2D12-D22D-490A-805A-5CB48E84F12A}\InProcServer32" /f /ve /d "\"%CD%\BCShellEx64.dll\"" >NUL
reg add "HKLM\SOFTWARE\Classes\CLSID\{57FA2D12-D22D-490A-805A-5CB48E84F12A}\InProcServer32" /f /v ThreadingModel /d "Apartment" >NUL

reg add "HKLM\SOFTWARE\Classes\*\shellex\ContextMenuHandlers\CirrusShellEx" /f /ve /d "{57FA2D12-D22D-490A-805A-5CB48E84F12A}" >NUL
reg add "HKLM\SOFTWARE\Classes\Folder\shellex\ContextMenuHandlers\CirrusShellEx" /f /ve /d "{57FA2D12-D22D-490A-805A-5CB48E84F12A}" >NUL
reg add "HKLM\SOFTWARE\Classes\lnkfile\shellex\ContextMenuHandlers\CirrusShellEx" /f /ve /d "{57FA2D12-D22D-490A-805A-5CB48E84F12A}" >NUL
reg add "HKLM\SOFTWARE\Classes\Directory\shellex\ContextMenuHandlers\CirrusShellEx" /f /ve /d "{57FA2D12-D22D-490A-805A-5CB48E84F12A}" >NUL

reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Approved" /f /v {57FA2D12-D22D-490A-805A-5CB48E84F12A} /d "Beyond Compare 4 Shell Extension" >NUL

reg add "HKLM\SYSTEM\CurrentControlSet\Services\EventLog\Application\Beyond Compare 4" /f /v TypesSupported /t REG_DWORD /d "7" >NUL 
reg add "HKLM\SYSTEM\CurrentControlSet\Services\EventLog\Application\Beyond Compare 4" /f /v EventMessageFile /d "\"%CD%\BCompare.exe\"" >NUL

ECHO.&ECHO 添加完成!创建快捷方式?
ECHO.&ECHO 是按任意键,否直接关闭!&PAUSE >NUL 2>NUL

mshta VBScript:Execute("Set a=CreateObject(""WScript.Shell""):Set b=a.CreateShortcut(a.SpecialFolders(""Desktop"") & ""\BCompare.lnk""):b.TargetPath=""%~DP0BCompare.exe"":b.WorkingDirectory=""%~DP0\"":b.Save:close")

CLS &ECHO.&ECHO 完成!&PAUSE >NUL 2>NUL & EXIT

删除右键的脚本:

@ECHO OFF & CD /D %~DP0 & TITLE ɾ³ýÓÒ¼ü www.Laomo.me
>NUL 2>&1 REG.exe query "HKU\S-1-5-19" || (
    ECHO SET UAC = CreateObject^("Shell.Application"^) > "%TEMP%\Getadmin.vbs"
    ECHO UAC.ShellExecute "%~f0", "%1", "", "runas", 1 >> "%TEMP%\Getadmin.vbs"
    "%TEMP%\Getadmin.vbs"
    DEL /f /q "%TEMP%\Getadmin.vbs" 2>NUL
    Exit /b
)

reg delete "HKLM\SOFTWARE\Classes\.bcss" /F>NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\.bcpkg" /F>NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\BeyondCompare.Snapshot" /F>NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\BeyondCompare.SettingsPackage" /F>NUL 2>NUL

reg delete "HKCU\SOFTWARE\Scooter Software\Beyond Compare" /F>NUL 2>NUL
reg delete "HKLM\SOFTWARE\Scooter Software\Beyond Compare" /F>NUL 2>NUL
reg delete "HKLM\SOFTWARE\Scooter Software\Beyond Compare 4" /F>NUL 2>NUL
reg delete "HKCU\SOFTWARE\Scooter Software\Beyond Compare 4" /F>NUL 2>NUL
reg delete "HKLM\SOFTWARE\WOW6432Node\Scooter Software\Beyond Compare" /F>NUL 2>NUL
reg delete "HKLM\SOFTWARE\WOW6432Node\Scooter Software\Beyond Compare 4" /F>NUL 2>NUL
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\BCompare.exe" /F>NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\CLSID\{57FA2D12-D22D-490A-805A-5CB48E84F12A}" /F>NUL 2>NUL
reg delete "HKLM\SYSTEM\CurrentControlSet\Services\EventLog\Application\Beyond Compare 4" /F>NUL 2>NUL
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Approved" /v {57FA2D12-D22D-490A-805A-5CB48E84F12A} /F>NUL 2>NUL


ECHO. &ECHO Íê³É£¡&PAUSE >NUL 2>NUL & EXIT



版权声明:本文为wanjietiam原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。