@echo off
if "%1"=="/s" goto step0

@echo.
echo ==================================================================
echo ===  Delete all FTDI VCOM drivers using CDMUninstaller         ===
echo ===  PrehKeyTec OCR Module "P1" (VID:0403 PID:F190)            ===
echo ===                                                            ===
echo ===  Operating Systems: Windows 2000,XP,Vista,7 (x32/x64)      ===
echo ===                                                            ===
echo ===  Attention!                                                ===
echo ===  Affects also other FTDI VirtualCOM installations !!!      ===
echo ===  Please run this script with Administrator grants!         ===
echo ===                                                            ===
echo ===  Option "/s" (silent) for unattended usage                 ===
echo ===                                                            ===
echo ===  prehkeytec/sz 2010-Feb-24                                 ===
echo ==================================================================
@echo.
pause

rem --- Return code 255: Uninstall cancelled by user.

:step0
echo.
echo -------------------------------------------------------------------------------
echo ATTENTION:
echo Deletion affects all other FTDI VirtualCOM installations on this PC !!!
echo -------------------------------------------------------------------------------
echo.
set choice=
set /p choice=Really delete all FTDI driver files? (Type YES - or press Enter to skip): 

if not '%choice%'=='' set choice=%choice:~0,3%
if '%choice%'=='YES' goto step1
if '%choice%'=='yes' goto step1
exit /B 255


:step1
"%~dp0\CDMUninstaller\CDMUninstaller.exe" 0403 F190 -l
if "%1"=="/s" exit /B %ERRORLEVEL%


:ende
echo.
echo -------------------------------------------------------------------------------
echo CDMUninstall executed - ReturnCode %ERRORLEVEL%
echo -------------------------------------------------------------------------------
echo.
pause
exit /B %ERRORLEVEL%
