Name of the tape in the device??? 
Author Message
 Name of the tape in the device???

Hello Guys.
How can I know the name of the tape in the tape device??? (in a W2K Server).
Using WSH-WMI-VB-VBS.

Thanks
Bye

Nelson Rodriguez

Salto - Uruguay



Mon, 05 Dec 2005 01:48:02 GMT  
 Name of the tape in the device???


Quote:
> Hello Guys.
> How can I know the name of the tape in the tape device??? (in a W2K
> Server). Using WSH-WMI-VB-VBS.

Maybe you can use this as a starting point:

        <comment>
            This GUID identifies the media library associated with the
           tape drive.
            To get it, run the command RSM VIEW /GUIDDISPLAY /tLIBRARY,
            and pick the GUID for your tape drive.  This is *only* used
            to drill down to the GUID of the specific tape currently
            inserted, in case we want to append to the tape.
        </comment>
        <resource id="MediaPool">"DLT"</resource>
        <resource id="MediaLibraryGUID">F8EF5F961A614105B434AA8114880B99</resource>

function IdentifyInsertedTape()
    dim oRun, cGUID(4)

    ' Library GUID for this tape drive
    cGUID(1) = getResource("MediaLibraryGUID")

    ' refresh removable storage library
    set oRun=wsh.exec("RSM refresh /lg" & cGUID(1))
    do while oRun.status=0 : wscript.sleep 100 : loop

    ' get physical media GUID
    set oRun=wsh.exec("RSM view /b /guiddisplay /tPHYSICAL_MEDIA /cg" & cGUID(1))
    do while oRun.status=0 : wscript.sleep 100 : loop
    cGUID(2) = "" & firstGUID(oRun.Stdout.Readall())
    ' wscript.echo cGUID(2)
    if len(cGUID(2))=0 then
        LogMsg "ERROR: Can't get PHYSICAL_MEDIA GUID; maybe no tape in drive?"
        LogMsg "CLOSE"
        wscript.quit
    end if

    ' get partition GUID
    set oRun=wsh.exec("RSM view /b /guiddisplay /tPARTITION /cg" & cGUID(2))
    do while oRun.status=0 : wscript.sleep 100 : loop
    cGUID(3) = "" & firstGUID(oRun.Stdout.Readall())
    ' wscript.echo cGUID(3)
    if len(cGUID(3))=0 then
        LogMsg "ERROR: Can't get PARTITION GUID; maybe unreadable tape?"
        LogMsg "CLOSE"
        wscript.Quit
    end if

    ' get logical media GUID
    set oRun=wsh.exec("RSM view /b /guiddisplay /tLOGICAL_MEDIA /cg" & cGUID(3))
    do while oRun.status=0 : wscript.sleep 100 : loop
    cGUID(4) = "" & firstGUID(oRun.Stdout.Readall())
    ' wscript.echo cGUID(4)
    if len(cGUID(4))=0 then
        LogMsg "NOTE: Can't get LOGICAL_MEDIA GUID; assuming blank tape"
        IdentifyInsertedTape="BLANK_MEDIA"
        exit function
    end if

    ' add dashes to logical media GUID
    IdentifyInsertedTape = left(cGUID(4),8) & "-" & mid(cGUID(4),9,4) & "-" _
  & mid(cGUID(4),13,4) & "-" & mid(cGUID(4),17,4) & "-" & mid(cGUID(4),21,12)
end function

--
Ross Presser -- rpresser AT imtek DOT com
"... VB is essentially the modern equivalent of vulgar Latin in 13th
Centurary Europe. Understand it, and you can travel to places you never
heard of and still understand some people." -- Alex K. Angelopoulos



Mon, 05 Dec 2005 04:05:48 GMT  
 Name of the tape in the device???
Ross I has error in this line:
cGUID(1) = getResource("MediaLibraryGUID")

Can you help me more?
Thanks
Nelson



Quote:


> > Hello Guys.
> > How can I know the name of the tape in the tape device??? (in a W2K
> > Server). Using WSH-WMI-VB-VBS.

> Maybe you can use this as a starting point:

>         <comment>
>             This GUID identifies the media library associated with the
>            tape drive.
>             To get it, run the command RSM VIEW /GUIDDISPLAY /tLIBRARY,
>             and pick the GUID for your tape drive.  This is *only* used
>             to drill down to the GUID of the specific tape currently
>             inserted, in case we want to append to the tape.
>         </comment>
>         <resource id="MediaPool">"DLT"</resource>
>         <resource

id="MediaLibraryGUID">F8EF5F961A614105B434AA8114880B99</resource>

- Show quoted text -

Quote:

> function IdentifyInsertedTape()
>     dim oRun, cGUID(4)

>     ' Library GUID for this tape drive
>     cGUID(1) = getResource("MediaLibraryGUID")

>     ' refresh removable storage library
>     set oRun=wsh.exec("RSM refresh /lg" & cGUID(1))
>     do while oRun.status=0 : wscript.sleep 100 : loop

>     ' get physical media GUID
>     set oRun=wsh.exec("RSM view /b /guiddisplay /tPHYSICAL_MEDIA /cg" &
cGUID(1))
>     do while oRun.status=0 : wscript.sleep 100 : loop
>     cGUID(2) = "" & firstGUID(oRun.Stdout.Readall())
>     ' wscript.echo cGUID(2)
>     if len(cGUID(2))=0 then
>         LogMsg "ERROR: Can't get PHYSICAL_MEDIA GUID; maybe no tape in
drive?"
>         LogMsg "CLOSE"
>         wscript.quit
>     end if

>     ' get partition GUID
>     set oRun=wsh.exec("RSM view /b /guiddisplay /tPARTITION /cg" &
cGUID(2))
>     do while oRun.status=0 : wscript.sleep 100 : loop
>     cGUID(3) = "" & firstGUID(oRun.Stdout.Readall())
>     ' wscript.echo cGUID(3)
>     if len(cGUID(3))=0 then
>         LogMsg "ERROR: Can't get PARTITION GUID; maybe unreadable tape?"
>         LogMsg "CLOSE"
>         wscript.Quit
>     end if

>     ' get logical media GUID
>     set oRun=wsh.exec("RSM view /b /guiddisplay /tLOGICAL_MEDIA /cg" &
cGUID(3))
>     do while oRun.status=0 : wscript.sleep 100 : loop
>     cGUID(4) = "" & firstGUID(oRun.Stdout.Readall())
>     ' wscript.echo cGUID(4)
>     if len(cGUID(4))=0 then
>         LogMsg "NOTE: Can't get LOGICAL_MEDIA GUID; assuming blank tape"
>         IdentifyInsertedTape="BLANK_MEDIA"
>         exit function
>     end if

>     ' add dashes to logical media GUID
>     IdentifyInsertedTape = left(cGUID(4),8) & "-" & mid(cGUID(4),9,4) &
"-" _
>   & mid(cGUID(4),13,4) & "-" & mid(cGUID(4),17,4) & "-" &
mid(cGUID(4),21,12)
> end function

> --
> Ross Presser -- rpresser AT imtek DOT com
> "... VB is essentially the modern equivalent of vulgar Latin in 13th
> Centurary Europe. Understand it, and you can travel to places you never
> heard of and still understand some people." -- Alex K. Angelopoulos



Wed, 07 Dec 2005 00:39:33 GMT  
 Name of the tape in the device???

Quote:
> Ross I has error in this line:
> cGUID(1) = getResource("MediaLibraryGUID")

> Can you help me more?

Read what I wrote.  

Quote:
>         <comment>
>             This GUID identifies the media library associated with the
>            tape drive.
>             To get it, run the command RSM VIEW /GUIDDISPLAY /tLIBRARY,
>             and pick the GUID for your tape drive.  This is *only* used
>             to drill down to the GUID of the specific tape currently
>             inserted, in case we want to append to the tape.
>         </comment>
>         <resource id="MediaPool">"DLT"</resource>
>         <resource id="MediaLibraryGUID">F8EF5F961A614105B434AA8114880B99

</resource>

--
Ross Presser -- rpresser AT imtek DOT com
"... VB is essentially the modern equivalent of vulgar Latin in 13th
Centurary Europe. Understand it, and you can travel to places you never
heard of and still understand some people." -- Alex K. Angelopoulos



Wed, 07 Dec 2005 01:52:28 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. How can I know the name of the tape in the tape device?

2. How can I know the name of the tape in the tape device?

3. audio-tape.ps v1.21 - print cassette/DAT/8mm tape box labels

4. how can I know that a tape drive does not contain a tape

5. printing date & device name via postscript commands

6. Need a PS procedure to get device-name string

7. what device device has replaced ras24

8. how to know if a tape drive contain a tape.

9. audio-tape.ps (long)

10. author of audio-tape.ps v1.25?

11. Cassette tape or MiniDisk label in Postscript

12. Accesso Tape (DAT) from VBscript .....

 

 
Powered by phpBB® Forum Software