I'm writing a small WMI script to return some information about the
physical disks on a desktop. The script is to be called while Windows
PE is running. Both versions of PE should support WMI, however, I'm
getting different results depending on which version of PE I run the
code under. I'm especially interested in getting the results for the
value of InterfaceType. Under Windows PE 1.6, the value is Null and
under Windows PE 2.0 the value is either IDE or USB (the correct
values). All other values are returned normally. I read that Windows
PE 2.0 does have expanded capabilities on what is available via WMI.
I was just wondering if others had seen similar behavior or if there
was a way to determine if the InterfaceType would ever be available
under PE 1.6?

Here is the script:

***************
Sub ListDiskDriveInfo( strComputer )
Dim objWMIService, colItems

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root
\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from
Win32_DiskDrive",,48)

For Each objItem in colItems

If objItem.InterfaceType <> "USB" then
If objItem.MediaType = "Fixed hard disk media" then
Wscript.Echo "Description: " & objItem.Description
Wscript.Echo "DeviceID: " & objItem.DeviceID
Wscript.Echo "Index: " & objItem.Index
GIndex = objItem.Index + 1
Wscript.Echo "Ghost Index: " & GIndex
Wscript.Echo "InterfaceType: " & objItem.InterfaceType
Wscript.Echo "MediaType: " & objItem.MediaType
Wscript.Echo "Name: " & objItem.Name
Wscript.Echo "Partitions: " & objItem.Partitions
Wscript.Echo "Size: " & objItem.Size
Wscript.Echo "Status: " & objItem.Status
Wscript.Echo "SystemName: " & objItem.SystemName
Wscript.Echo "********************* "
End If
End If
Next

End Sub


'
****************************************************************************
' Main
'
****************************************************************************
Dim strComputer
'* Do
'* strComputer = inputbox( "Please enter a computername or . for local
computer", "Input" )
'* Loop until strComputer <> ""

strComputer = "."

ListDiskDriveInfo( strComputer )
**************

Re: VBS Script/WMI results different in Windows PE 1.6 vs. Windows PE 2.0 by ThatsIT

ThatsIT
Sun Sep 02 05:57:30 PDT 2007

What object are you working with

InterfaceType is a property of what object?


<brett.aurand@comcast.net> wrote in message
news:1188589009.902873.49060@57g2000hsv.googlegroups.com...
>
> I'm writing a small WMI script to return some information about the
> physical disks on a desktop. The script is to be called while Windows
> PE is running. Both versions of PE should support WMI, however, I'm
> getting different results depending on which version of PE I run the
> code under. I'm especially interested in getting the results for the
> value of InterfaceType. Under Windows PE 1.6, the value is Null and
> under Windows PE 2.0 the value is either IDE or USB (the correct
> values). All other values are returned normally. I read that Windows
> PE 2.0 does have expanded capabilities on what is available via WMI.
> I was just wondering if others had seen similar behavior or if there
> was a way to determine if the InterfaceType would ever be available
> under PE 1.6?
>
> Here is the script:
>
> ***************
> Sub ListDiskDriveInfo( strComputer )
> Dim objWMIService, colItems
>
> Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root
> \cimv2")
> Set colItems = objWMIService.ExecQuery("Select * from
> Win32_DiskDrive",,48)
>
> For Each objItem in colItems
>
> If objItem.InterfaceType <> "USB" then
> If objItem.MediaType = "Fixed hard disk media" then
> Wscript.Echo "Description: " & objItem.Description
> Wscript.Echo "DeviceID: " & objItem.DeviceID
> Wscript.Echo "Index: " & objItem.Index
> GIndex = objItem.Index + 1
> Wscript.Echo "Ghost Index: " & GIndex
> Wscript.Echo "InterfaceType: " & objItem.InterfaceType
> Wscript.Echo "MediaType: " & objItem.MediaType
> Wscript.Echo "Name: " & objItem.Name
> Wscript.Echo "Partitions: " & objItem.Partitions
> Wscript.Echo "Size: " & objItem.Size
> Wscript.Echo "Status: " & objItem.Status
> Wscript.Echo "SystemName: " & objItem.SystemName
> Wscript.Echo "********************* "
> End If
> End If
> Next
>
> End Sub
>
>
> '
> ****************************************************************************
> ' Main
> '
> ****************************************************************************
> Dim strComputer
> '* Do
> '* strComputer = inputbox( "Please enter a computername or . for local
> computer", "Input" )
> '* Loop until strComputer <> ""
>
> strComputer = "."
>
> ListDiskDriveInfo( strComputer )
> **************
>


Re: VBS Script/WMI results different in Windows PE 1.6 vs. Windows PE 2.0 by brett

brett
Tue Sep 04 06:59:42 PDT 2007


Win32_DiskDrive

Set colItems =3D objWMIService.ExecQuery("Select * from
Win32_DiskDrive",,48)




On Sep 2, 8:57 am, "ThatsIT.net.au" <me@thatsit> wrote:
> What object are you working with
>
> InterfaceType is a property of what object?
>
> <brett.aur...@comcast.net> wrote in message
>
> news:1188589009.902873.49060@57g2000hsv.googlegroups.com...
>
>
>
>
>
> > I'm writing a smallWMIscript to return some information about the
> > physical disks on a desktop. The script is to be called while Windows
> > PE is running. Both versions of PE should supportWMI, however, I'm
> > getting different results depending on which version of PE I run the
> > code under. I'm especially interested in getting the results for the
> > value of InterfaceType. Under Windows PE 1.6, the value is Null and
> > under Windows PE 2.0 the value is either IDE or USB (the correct
> > values). All other values are returned normally. I read that Windows
> > PE 2.0 does have expanded capabilities on what is available viaWMI.
> > I was just wondering if others had seen similar behavior or if there
> > was a way to determine if the InterfaceType would ever be available
> > under PE 1.6?
>
> > Here is the script:
>
> > ***************
> > Sub ListDiskDriveInfo( strComputer )
> > Dim objWMIService, colItems
>
> > Set objWMIService =3D GetObject("winmgmts:\\" & strComputer & "\root
> > \cimv2")
> > Set colItems =3D objWMIService.ExecQuery("Select * from
> > Win32_DiskDrive",,48)
>
> > For Each objItem in colItems
>
> > If objItem.InterfaceType <> "USB" then
> > If objItem.MediaType =3D "Fixed hard disk media" then
> > Wscript.Echo "Description: " & objItem.Description
> > Wscript.Echo "DeviceID: " & objItem.DeviceID
> > Wscript.Echo "Index: " & objItem.Index
> > GIndex =3D objItem.Index + 1
> > Wscript.Echo "Ghost Index: " & GIndex
> > Wscript.Echo "InterfaceType: " & objItem.InterfaceType
> > Wscript.Echo "MediaType: " & objItem.MediaType
> > Wscript.Echo "Name: " & objItem.Name
> > Wscript.Echo "Partitions: " & objItem.Partitions
> > Wscript.Echo "Size: " & objItem.Size
> > Wscript.Echo "Status: " & objItem.Status
> > Wscript.Echo "SystemName: " & objItem.SystemName
> > Wscript.Echo "********************* "
> > End If
> > End If
> > Next
>
> > End Sub
>
> > '
> > ***********************************************************************=
****=AD*
> > ' Main
> > '
> > ***********************************************************************=
****=AD*
> > Dim strComputer
> > '* Do
> > '* strComputer =3D inputbox( "Please enter a computername or . for local
> > computer", "Input" )
> > '* Loop until strComputer <> ""
>
> > strComputer =3D "."
>
> > ListDiskDriveInfo( strComputer )
> > **************- Hide quoted text -
>
> - Show quoted text -



Re: VBS Script/WMI results different in Windows PE 1.6 vs. Windows PE 2.0 by ThatsIT

ThatsIT
Tue Sep 04 07:44:39 PDT 2007

requirements seem to be met
see requirements near bottom of page
http://msdn2.microsoft.com/en-US/library/aa394132.aspx

if requirements are met then maybe the device can not return the property.
try putting in a flash drive and then see if that gives an answer. if it
does you can say the device has a problem, if it doesn't then your back
where you started from.

I did not read your post correctly the first time, I think that it may be
that its simply not supported with PE1.6

<brett.aurand@comcast.net> wrote in message
news:1188914382.177070.321390@w3g2000hsg.googlegroups.com...

Win32_DiskDrive

Set colItems = objWMIService.ExecQuery("Select * from
Win32_DiskDrive",,48)




On Sep 2, 8:57 am, "ThatsIT.net.au" <me@thatsit> wrote:
> What object are you working with
>
> InterfaceType is a property of what object?
>
> <brett.aur...@comcast.net> wrote in message
>
> news:1188589009.902873.49060@57g2000hsv.googlegroups.com...
>
>
>
>
>
> > I'm writing a smallWMIscript to return some information about the
> > physical disks on a desktop. The script is to be called while Windows
> > PE is running. Both versions of PE should supportWMI, however, I'm
> > getting different results depending on which version of PE I run the
> > code under. I'm especially interested in getting the results for the
> > value of InterfaceType. Under Windows PE 1.6, the value is Null and
> > under Windows PE 2.0 the value is either IDE or USB (the correct
> > values). All other values are returned normally. I read that Windows
> > PE 2.0 does have expanded capabilities on what is available viaWMI.
> > I was just wondering if others had seen similar behavior or if there
> > was a way to determine if the InterfaceType would ever be available
> > under PE 1.6?
>
> > Here is the script:
>
> > ***************
> > Sub ListDiskDriveInfo( strComputer )
> > Dim objWMIService, colItems
>
> > Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root
> > \cimv2")
> > Set colItems = objWMIService.ExecQuery("Select * from
> > Win32_DiskDrive",,48)
>
> > For Each objItem in colItems
>
> > If objItem.InterfaceType <> "USB" then
> > If objItem.MediaType = "Fixed hard disk media" then
> > Wscript.Echo "Description: " & objItem.Description
> > Wscript.Echo "DeviceID: " & objItem.DeviceID
> > Wscript.Echo "Index: " & objItem.Index
> > GIndex = objItem.Index + 1
> > Wscript.Echo "Ghost Index: " & GIndex
> > Wscript.Echo "InterfaceType: " & objItem.InterfaceType
> > Wscript.Echo "MediaType: " & objItem.MediaType
> > Wscript.Echo "Name: " & objItem.Name
> > Wscript.Echo "Partitions: " & objItem.Partitions
> > Wscript.Echo "Size: " & objItem.Size
> > Wscript.Echo "Status: " & objItem.Status
> > Wscript.Echo "SystemName: " & objItem.SystemName
> > Wscript.Echo "********************* "
> > End If
> > End If
> > Next
>
> > End Sub
>
> > '
> > ***************************************************************************­*
> > ' Main
> > '
> > ***************************************************************************­*
> > Dim strComputer
> > '* Do
> > '* strComputer = inputbox( "Please enter a computername or . for local
> > computer", "Input" )
> > '* Loop until strComputer <> ""
>
> > strComputer = "."
>
> > ListDiskDriveInfo( strComputer )
> > **************- Hide quoted text -
>
> - Show quoted text -