@echo off

:: The next section will find the drive letter of the CD.
:: If you know specifically where the drive letter is you
:: can force it in the next line
set drive=C:
:: and then remove the ':: ' on the next line
:: goto work

:: ========================================
:: FIND THE DRIVE LETTER OF THE SERVICE PARTITION
:: ========================================
if not exist C:\setup\ibmtpi.xml goto notc
set drive=C:\setup
echo Source Drive  set to: %drive%
goto work
:notc
if not exist D:\setup\ibmtpi.xml goto notd
set drive=D:\setup
echo Source Drive  set to: %drive%
goto work
:notd
if not exist e:\setup\ibmtpi.xml goto note
set drive=E:\setup
echo Source Drive set to: %drive%
goto work
:note
if not exist f:\setup\ibmtpi.xml goto notf
set drive=F:\setup
echo Source Drive set to: %drive%
goto work
:notf
if not exist g:\setup\ibmtpi.xml goto fail
set drive=G:\setup
echo Source Drive set to: %drive%
goto work

:fail
ECHO The source location was not found
goto finish


:work

echo Uninstalling Access Connections... please be patient... wait till completion.
:: uncomment one and comment other option lines as required

::1- Silent uninstall but location profiles not removed
start /WAIT %drive%\ACCON\setup.exe /h -s -f1%drive%\ACCON\uninst.iss -f2%temp%\ACuninstall.log -remove

::2- Silent uninstall and all location profiles removed 
::start /WAIT %drive%\ACCON\setup.exe /h -s -f1%drive%\ACCON\uninstp.iss -f2%temp%\ACuninstall.log -remove

echo completed...Need restart.



:finish

