@echo off
REM Script strongly based on ngemu - DarkSilhouette's work.
REM see: https://www.ngemu.com/threads/remove-epsxe-pcsxr-settings.197337/
cls
echo.
echo.
echo. Script strongly based on ngemu - DarkSilhouette's work.
echo. see: https://www.ngemu.com/threads/remove-epsxe-pcsxr-settings.197337/
echo.
echo.
reg query "HKEY_CURRENT_USER\SOFTWARE\epsxe" > nul 2>&1
if %ERRORLEVEL% EQU 0 (
   echo ePSXe found.
   echo ePSXe found: %date% - %time% >> reg-txt-bkp.txt 2>&1
   reg query "HKEY_CURRENT_USER\SOFTWARE\epsxe" /S >> reg-txt-bkp.txt 2>&1
   echo. -- -- -- -- -- -- -- >> reg-txt-bkp.txt 2>&1
   echo/ >> reg-txt-bkp.txt 2>&1
   echo/ >> reg-txt-bkp.txt 2>&1
   reg export "HKEY_CURRENT_USER\SOFTWARE\epsxe" HKCU_SOFT_EPSXE.reg /y
   REM The next command demands administrative privilege
   REM reg save "HKEY_CURRENT_USER\SOFTWARE\epsxe" HKCU_SOFT_EPSXE.hiv /y
) else (
   echo ePSXe NOT found!
)
reg query "HKEY_CURRENT_USER\SOFTWARE\pcsxr" > nul 2>&1
if %ERRORLEVEL% EQU 0 (
   echo PCSXR-PGXP found.
   echo PCSXR-PGXP found: %date% - %time% >> reg-txt-bkp.txt 2>&1
   reg query "HKEY_CURRENT_USER\SOFTWARE\pcsxr" /S >> reg-txt-bkp.txt 2>&1
   echo. -- -- -- -- -- -- -- >> reg-txt-bkp.txt 2>&1
   echo/ >> reg-txt-bkp.txt 2>&1
   echo/ >> reg-txt-bkp.txt 2>&1
   reg export "HKEY_CURRENT_USER\SOFTWARE\pcsxr" HKCU_SOFT_PCSXR-PXGP.reg /y
   REM The next command demands administrative privilege
   REM reg save "HKEY_CURRENT_USER\SOFTWARE\pcsxr" HKCU_SOFT_PCSXR-PXGP.hiv /y
) else (
  echo PCSXR-PGXP NOT found!
)
reg query "HKEY_CURRENT_USER\SOFTWARE\Vision Thing" > nul 2>&1
if %ERRORLEVEL% EQU 0 (
  echo OLD PSX Plugins found.
  echo OLD PSX Plugins found: %date% - %time% >> reg-txt-bkp.txt 2>&1
  reg query "HKEY_CURRENT_USER\SOFTWARE\Vision Thing" /S >> reg-txt-bkp.txt 2>&1
  echo. -- -- -- -- -- -- -- >> reg-txt-bkp.txt 2>&1
  echo/ >> reg-txt-bkp.txt 2>&1
  echo/ >> reg-txt-bkp.txt 2>&1
  reg export "HKEY_CURRENT_USER\SOFTWARE\Vision Thing" HKCU_SOFT_VT-OLD.reg /y
  REM The next command demands administrative privilege
  REM reg save "HKEY_CURRENT_USER\SOFTWARE\Vision Thing" HKCU_SOFT_VT-OLD.hiv /y
) else (
  echo OLD PSX Plugins NOT found!
)
timeout /NOBREAK /T 15
exit /B

:: Difference between "reg save" and "reg export"?
:: see: https://superuser.com/questions/330180/difference-between-reg-save-and-reg-export