You might try something like this:
Code:
@echo off
set CD=F:
:Begin
cls
ctty nul
command /f /c vol %CD%|find " is "
ctty con
if errorlevel 1 goto Fail
echo *** Success reading drive %CD% ***
vol %CD%
echo.
goto End
:Fail
cls
echo.
echo *** Error reading drive %CD% ***
echo.
echo Your two options are:
echo.
echo 1) Insert a data CD in drive %CD%
echo.
echo or
echo.
echo 2) Quit trying and exit to DOS
echo.
choice /c:12 /n "Which do you prefer? ([1]/[2]): "
echo.
if errorlevel 2 goto End
goto Begin
:End
Notes:- Be sure and change that "F:" on the second line to the drive letter of your CD-ROM drive.
- CHOICE.COM and FIND.EXE must both be somewhere in your PATH.