@ECHO OFF
:START
TITLE Icon Pack Installer Cleanup Tool.
CLS
ECHO.
ECHO.###########################################################
ECHO.##          Icon Pack Uninstaller Cleanup Tool           ##
ECHO.##          ----------------------------------           ##
ECHO.##                                                       ##
ECHO.##  !THIS TOOL SHOULD ONLY BE RAN AFTER UNINSTALLATION!  ##
ECHO.##   DISABLE USER ACCOUNT CONTROL BEFORE PRESSING '1'!!  ##
ECHO.##                                                       ##
ECHO.## THIS FILE MUST BE RAN AS ADMIN FOR IT TO TAKE EFFECT! ##
ECHO.##                                                       ##
ECHO.##   Please also close all programs before proceeding.   ##
ECHO.##                                                       ##
ECHO.###########################################################
ECHO.
ECHO.
ECHO.Are you sure you want to cleanup after the icon pack uninstall?
ECHO.
ECHO.----------- 
ECHO.1. Yes.
ECHO.2. No.
ECHO.----------- 
set /p userinp=Please choose a number(1-2):
set userinp=%userinp:~0,1%
if "%userinp%"=="1" goto 1
if "%userinp%"=="2" goto 2
echo invalid choice
goto start
:1
GOTO INSTALLSCRIPTBEGIN
:2
GOTO ALREADYPATCHEDEXIT


:INSTALLSCRIPTBEGIN
:PERMISSIONCHK
	ATTRIB %windir%\system32 -h | FINDSTR /I "denied" >nul
	IF NOT ERRORLEVEL 1 (
		ECHO.
		ECHO.This script must be ran as an Administrator and with 
		ECHO.'User Account Control' completely disabled!!
		ECHO.
		GOTO END
	)

IF /I EXIST %systemroot%\SysWOW64 SET BIT=Y

del %windir%\system32\imageres.dll.bak
del %windir%\system32\shell32.dll.bak
del %windir%\system32\imagesp1.dll.bak
IF '%BIT%'=='Y' (
del %windir%\SysWOW64\imageres.dll.bak
del %windir%\SysWOW64\shell32.dll.bak
del %windir%\SysWOW64\imagesp1.dll.bak
) ELSE (GOTO NOT64)
:NOT64
PAUSE

:END
:ALREADYPATCHEDEXIT
:JUSTEXIT