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 )
**************