@echo off

SET choice=a

set EXE_FILE=not_defined
if "%PROCESSOR_ARCHITECTURE%" == "AMD64" (
	set ICE_REV=40
) else (
	set ICE_REV=01
)

set EXE_FILE=not_defined
if EXIST ..\..\setup\hpzscr01.exe SET EXE_FILE=..\..\setup\hpzscr01.exe
if EXIST hpzscr01.exe SET EXE_FILE=hpzscr01.exe
if "%EXE_FILE%" == "not_defined" goto MISSING_SCRUBBER_EXE

set SCRUBBER_DAT_FILE=not_defined
if EXIST ..\..\setup\hpwscr13.dat SET SCRUBBER_DAT_FILE=hpwscr13.dat
if EXIST hpwscr13.dat SET SCRUBBER_DAT_FILE=hpwscr13.dat
if "SCRUBBER_DAT_FILE" == "not_defined" goto MISSING_PRODUCT_SCRUBBER_DATFILE


echo "******************** Executing Level2 CleanUP *********************"
echo Use this LEVEL 2 cleanup utility if you are having a communication 
echo problem with your HP Officejet K7100  and the LEVEL 1 cleanup utility 
echo did not fix the problem.
echo "*******************************************************************"
echo.
echo.
echo If you chose to UNINSTALL, Please do the following...
echo 1. Disconnect the device from your computer.
echo NOTE: It is important that you disconnect the device before restarting your computer.
echo 2. After the uninstall process finishes, restart the computer.
echo 3. Connect the device to your computer. If prompted for a printer driver, 
echo    select "Install the software automatically (Recommended)", and then press "Next". 
echo 4. Follow the onscreen instructions to complete the installation.
echo 5. To verify that the software has been installed, print a document from an application that you use frequently.
echo.
echo.

if Windows_NT==%OS% GOTO WIN2K_XP
GOTO WIN9x_ME

:WIN2K_XP
echo Press ENTER to continue Uninstalling... 
echo              OR 
echo Press Q followed by ENTER to QUIT uninstallation

SET /P Choice=

IF /I ‘%choice:~0,1%’==’Q’ GOTO END_QUIT

GOTO DISPLAY

:WIN9x_ME
choice /C:cq Press Q to quit Uninstall OR press C to continue...
if ERRORLEVEL==2 GOTO END_QUIT
if ERRORLEVEL==1 GOTO DISPLAY

GOTO END_QUIT

:DISPLAY
if "%SCRUBBER_DAT_FILE%" == "not_defined" goto MISSING_PRODUCT_SCRUBBER_DATFILE
start /w %EXE_FILE% -datfile %SCRUBBER_DAT_FILE% -unattended -showdisconnect -nocopytotemp -forcereboot

goto END

:MISSING_PRODUCT_SCRUBBER_DATFILE
echo "**** Uninstall file not found: hpwscr??.dat ****"
goto EXIT

:MISSING_SCRUBBER_EXE
echo "**** Uninstall file not found: hpzscr01.exe ****"
goto EXIT



:END
echo Uninstallation Completed. THANKS!

:END_QUIT
echo DONE.
pause

:END_LAST


:EXIT

