I would occasionally forget to insert a tape in my tape drive, and arrive the next morning to find that my scheduled Ntbackup is waiting for me to mount a tape.
To avoid this behavior, I first determined the GUID of my tape device, by opening a CMD prompt and typing:
rsm view /tlibrary /guiddisplay.
This returned a display that included:
HP C1537A SCSI Sequential Device C888E08900454C4C956DF84868C17C78.
If you type:
rsm view /cgC888E08900454C4C956DF84868C17C78 /TPhysical_media
you receive a display similar to:
2002_10_30_18_00 - 1
The command completed successfully.
where 2002_10_30_18_00 - 1 is the tape label.
Using this information, I added the following to my script, before the Ntbackup command:
for /f "Tokens=*" %%a in ('rsm view /cgC888E08900454C4C956DF84868C17C78 /TPhysical_media') do (
if not "%%a"=="The command completed successfully." set media="%%a"
if /i %media% EQU "Unable to open session with the RSM server." goto checkmedia
if /i %media% EQU "PHYSICAL_MEDIA" goto notape
if not defined media goto notape
NOTE: If I knew that someone was in the office, I could have also used net send.