@echo off

:: save registry
REGEDIT /S /E "%~dp0settings.reg" "HKEY_CURRENT_USER\Software\Microsoft\Dependency Walker"

:: cleanup registry
REG DELETE "HKEY_CURRENT_USER\Software\Microsoft\Dependency Walker" /f
REG COPY "HKEY_CURRENT_USER\Software\Microsoft\Dependency Walker_backup" "HKEY_CURRENT_USER\Software\Microsoft\Dependency Walker" /s /f
REG DELETE "HKEY_CURRENT_USER\Software\Microsoft\Dependency Walker_backup" /f

REG DELETE "HKEY_CLASSES_ROOT\dwifile" /f
REG COPY "HKEY_CLASSES_ROOT\dwifile_backup" "HKEY_CLASSES_ROOT\dwifile" /s /f
REG DELETE "HKEY_CLASSES_ROOT\dwifile_backup" /f

REG DELETE "HKEY_CLASSES_ROOT\dwpfile" /f
REG COPY "HKEY_CLASSES_ROOT\dwpfile_backup" "HKEY_CLASSES_ROOT\dwpfile" /s /f
REG DELETE "HKEY_CLASSES_ROOT\dwpfile_backup" /f