@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 Updating... please be patient... wait till completion.

::1- Silent install and prompts for reboot
start /WAIT %drive%\setup.exe /S /H /R

::2- Silent install and no reboot --uncomment next line and comment others
::start /WAIT %drive%\setup.exe /S /H /R:0

::3- Silent install and forced reboot after completion --uncomment next line and comment others
::start /WAIT %drive%\setup.exe /S /H /R:2

::4- Interactive install and prompts for reboot --uncomment next line and comment others
::start /WAIT %drive%\setup.exe /R

echo completed...Need restart.

:: Import the RUNONCE command now....




:finish

