@echo off

Set zr1cDir=%APPDATA%\RF Enabled\ZR1C
if exist "%zr1cDir%" (
	rd /Q /S "%zr1cDir%"
	if %ERRORLEVEL% GTR 0 goto :lError1
	rd /Q "%APPDATA%\RF Enabled"
)

set zr1cReg=HKCU\Software\RF Enabled
set f=0
for /f "tokens=4 delims=\" %%i in ('reg query "%zr1cReg%"') do (
	if "%%i" == "ZR1C" (
		reg delete "%zr1cReg%\%%i" /f
	) else (
		set f=1
	)
)
if "%f%" == "0" reg delete "%zr1cReg%" /f

goto :finish

:lError1
echo Error %ERRORLEVEL%!
pause
goto :finish

:finish
echo.
