JSI Tip 4540. What media do I have in my tape library?


You can right-click My Computer and press Manage to use the Removable Storage snap-in to find out, or you can run PhysicalMedia.bat.

PhysicalMedia.bat uses the RSM command to write a file containing the media labels and associated GUIDs.

The syntax is:

PhysicalMedia OutputFileName

PhysicalMedia.bat contains:

@echo off
setlocal
if \{%1\}

\{\} goto syntax set file=%1 if NOT \{%2\}

\{\} goto syntax if not exist %~dp1 goto syntax if exist %file% del /q %file% If exist %temp%\PhysicalMedia.tmp del /q %temp%\PhysicalMedia.tmp for /f "Skip=2 Tokens=*" %%i in ('rsm view /tphysical_media /guiddisplay') do set line=%%i&call :sortin sort %temp%\PhysicalMedia.tmp /o %file% del /q %temp%\PhysicalMedia.tmp endlocal goto :EOF :syntax @echo PhysicalMedia OutputFileName endlocal goto :EOF :sortin if "%line%" EQU "The command completed successfully." goto :EOF @echo %line%>>%temp%\PhysicalMedia.tmp
NOTE: See tip 2265 » How do I perform an NTBackup in Windows 2000, without having to manually manage the media?




Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish