@echo off

:: save registry
REGEDIT /S /E "%~dp0settings.reg" "HKEY_CURRENT_USER\Software\Thingamahoochie\WinMerge"

:: cleanup registry
REG DELETE "HKEY_CURRENT_USER\Software\Thingamahoochie\WinMerge" /f
REG COPY "HKEY_CURRENT_USER\Software\Thingamahoochie\WinMerge_backup" "HKEY_CURRENT_USER\Software\Thingamahoochie\WinMerge" /s /f
REG DELETE "HKEY_CURRENT_USER\Software\Thingamahoochie\WinMerge_backup" /f