Subscribe to Windows IT Pro
November 14, 2002 12:00 AM

JSI Tip 5961. How do I Deallocate the mounted tape in a command script?

Windows IT Pro
InstantDoc ID #77265
Rating: (0)


In tip 5955, I used the RSM VIEW command to determine if a tape was inserted in a tape drive.

Using rsm view /cgC888E08900454C4C956DF84868C17C78 /TPhysical_media, where C888E08900454C4C956DF84868C17C78 is the GUID of my tape library, the following commands set the media variable to the Physical_Media id of the mounted tape:

set media=
for /f "Skip=2 Tokens=*" %%a in ('rsm view /cgC888E08900454C4C956DF84868C17C78 /TPhysical_media') do if not "%%a"=="The command completed successfully." set media="%%a"
if not defined media goto notape
You can use the Partition Id with the Deallocate command.

To determine the Partition Id and issue a Deallocate:

set partition=%media: - 1=%
rsm.exe deallocate /PF%partition%



Related Content:

ARTICLE TOOLS

Comments
    There are no comments to display. Be the first one!
You must log on before posting a comment.

Are you a new visitor? Register Here

advertisement

advertisement

Windows is a trademark of the Microsoft group of companies. Windows IT Pro is used by Penton Media Inc. under license from owner.