echo OFF
rem
rem	Usage:  CHK_TAPE [-t] [-c] [-m]
rem		-t ... do not print program title
rem             -c ... do not print tape configuration info
rem             -m ... do not print tape status
rem
rem	CHK_TAPE returns with the following errorlevels:
rem		0 - tape system is ready
rem		1 - command syntax error
rem		2 - tape is write protected
rem		3 - tape is not mounted or power is off
rem		4 - tape system in error
rem

:loop
cls
CHK_TAPE -tcm
if errorlevel 4 goto level4
if errorlevel 3 goto level3
if errorlevel 2 goto level2
if errorlevel 1 goto level1
goto exit

:level1
echo Command syntax error!
goto wait

:level2
echo Tape is write protected!
goto wait

:level3
echo Tape is not mounted or powered!
goto wait

:level4
echo Tape system error!

:wait
pause
goto loop

:exit
echo on
cls
