@echo off

:: backup registry
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

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

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

:: restore registry
REGEDIT /S "%~dp0settings.reg"