@echo off

rem Looking for the DVD drive letter

set DVDROM=

:0
goto search

:error
echo Please insert the DVD %1
pause

:search
FOR %%i IN (C D E F G H I J K L M N O P Q R S T U V W X Y Z) DO (
IF EXIST "%%i:\DVDROM%1.TXT" (
set DVDROM=%%i:
goto end
)
)
FOR %%i IN (C D E F G H I J K L M N O P Q R S T U V W X Y Z) DO (
IF EXIST "%%i:\SETUPROOT\DVDROM%1.TXT" (
set DVDROM=%%i:\SETUPROOT
goto end
)
)
goto error

:end
rem We can now use %DVDROM%

