@echo off

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

:: cleanup registry
REG DELETE "HKEY_CURRENT_USER\Software\MJLSoftware\SyncBack" /f
REG DELETE "HKEY_CURRENT_USER\Software\Classes\.sps" /f
REG DELETE "HKEY_CURRENT_USER\Software\Classes\spsfile" /f

REG COPY "HKEY_CURRENT_USER\Software\MJLSoftware\SyncBack_backup" "HKEY_CURRENT_USER\Software\MJLSoftware\SyncBack" /s /f
REG COPY "HKEY_CURRENT_USER\Software\Classes\.sps_backup" "HKEY_CURRENT_USER\Software\Classes\.sps" /s /f
REG COPY "HKEY_CURRENT_USER\Software\Classes\spsfile_backup" "HKEY_CURRENT_USER\Software\Classes\spsfile" /s /f

REG DELETE "HKEY_CURRENT_USER\Software\MJLSoftware\SyncBack_backup" /f
REG DELETE "HKEY_CURRENT_USER\Software\Classes\.sps_backup" /f
REG DELETE "HKEY_CURRENT_USER\Software\Classes\spsfile_backup" /f