Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple way to eject tapes?

Status
Not open for further replies.

godfra

IS-IT--Management
Sep 20, 2004
28
GB
Hi all,

I have a backup script that runs using NTBACKUP every night on a W2K server box.

There is only one tape drive in the machine. All I want is a simple command that will eject whatever tape is in the drive. I do not want to have to specify physicalmedia id, friendly name, GUID, any of that rubbish.

All I want is a straightforward "whatever's in there, eject it" type command.

Can anyone help me at all?




Anyone?!?
 
Found out how in the end, posting the answer up here incase anyone else wants it.

-godfra

REM Set library GUID (to get this number use 'rsm view /tlibrary /guiddisplay')
REM ---------------------------------------------------------------------------
set drvguid=YourDriveGUIDGoesHere

REM Eject Tape
REM ----------
rsm refresh /lg%drvguid%
FOR /F "usebackq" %%i IN (`rsm view /tphysical_media /cg%drvguid% /b /guiddisplay`) DO set x=%%i
rsm eject /pg%X% /astart

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top