@echo off

SET choice=a

rem !!!!!!!!!!!!!!!! Set Scrubber Exe Name
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

rem !!!!!!!!!!!!!!!! Set Scrubber Dat File Name
set FILE_CDA=not_defined
if EXIST ..\..\setup\hposcr17.dat SET FILE_CDA=hposcr17.dat
if EXIST hposcr17.dat SET FILE_CDA=hposcr17.dat
SET FILE_CDA=hposcr17.dat

set SCRUBBER_DAT_FILE=not_defined

if "%FILE_CDA%" == "not_defined" goto DAT_SCRUBBER
SET SCRUBBER_DAT_FILE=%FILE_CDA%
goto DAT_SCRUBBER

:DAT_SCRUBBER
if "%SCRUBBER_DAT_FILE%" == "not_defined" echo "**** Uninstall file not found: hposcr??.dat ****"


echo ******************** Executing Level3 CleanUP *********************
echo This cleanup utility will remove the HP Image Zone software 
echo and the HP product drivers. Use this utility to remove software if you are
echo having a problem using the software and would like to reinstall the software
echo ********************************************************************
echo.
echo.
echo If you chose to UNINSTALL, Please do the following...
echo 1. Unplug the USB cable from the back of your HP All-in-One device
echo 2. After the cleanup finishes, restart your computer and wait for Windows to 
echo    start up
echo 3. Eject and re-insert the software CD that came with your HP All-in-One 
echo    device to start the installation
echo 4. Follow the on-screen instructions to finish the installation
echo 5. Try printing a document to confirm functionality
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

start /w %EXE_FILE% -datfile %SCRUBBER_DAT_FILE% -unattended -showdisconnect -nocopytotemp -noreboot

start /w %EXE_FILE% -datfile hpqscr01.dat -unattended -nocopytotemp -noreboot

start /w %EXE_FILE% -datfile hpqbud01.dat -unattended -nocopytotemp -noreboot

start /w %EXE_FILE% -datfile hpqbud05.dat -unattended -nocopytotemp -noreboot

start /w %EXE_FILE% -datfile hpqbud06.dat -unattended -nocopytotemp -noreboot

start /w %EXE_FILE% -datfile hpqbud11.dat -unattended -nocopytotemp -noreboot

start /w %EXE_FILE% -datfile hpqbud13.dat -unattended -nocopytotemp -noreboot

start %EXE_FILE% -datfile hpqhsc01.dat -unattended -nocopytotemp -forcereboot

goto END


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


:END
echo Uninstallation Completed.

:END_QUIT
echo DONE.

:EXIT