Enumerate 2k devices and drivers

  • Thread starter Thread starter William Hymen
  • Start date Start date
W

William Hymen

Does anyone have a script to enumerate Win2k Devices and drivers?
Right now, to list my drivers and devices, I have to ....

RightClick [My Computer]
Select [Manage]
DoubleClick [Device Manager]
[+] Expand each unique entry
[+] Expand each sub-entry
RightClick [Properties]
Drill-Down

Write everything down Manually!!!!


Thanks in advance-

Bill
 
Examples from The Portable Script Center
(http://www.microsoft.com/technet/scriptcenter/)

Enumerating Plug and Play Devices:

strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_PnPEntity")
For Each objItem in colItems
Wscript.Echo "Class GUID: " & objItem.ClassGuid
Wscript.Echo "Description: " & objItem.Description
Wscript.Echo "Device ID: " & objItem.DeviceID
Wscript.Echo "Manufacturer: " & objItem.Manufacturer
Wscript.Echo "Name: " & objItem.Name
Wscript.Echo "PNP Device ID: " & objItem.PNPDeviceID
Wscript.Echo "Service: " & objItem.Service
Next

Enumerating Plug and Play Signed Drivers:

On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from
Win32_PnPSignedDriver")
For Each objItem in colItems
Wscript.Echo "Class Guid: " & objItem.ClassGuid
Wscript.Echo "Compatability ID: " & objItem.CompatID
Wscript.Echo "Description: " & objItem.Description
Wscript.Echo "Device Class: " & objItem.DeviceClass
Wscript.Echo "Device ID: " & objItem.DeviceID
Wscript.Echo "Device Name: " & objItem.DeviceName
dtmWMIDate = objItem.DriverDate
strReturn = WMIDateStringToDate(dtmWMIDate)
Wscript.Echo "Driver Date: " & strReturn
Wscript.Echo "Driver Provider Name: " & objItem.DriverProviderName
Wscript.Echo "Driver Version: " & objItem.DriverVersion
Wscript.Echo "HardWare ID: " & objItem.HardWareID
Wscript.Echo "Inf Name: " & objItem.InfName
Wscript.Echo "Is Signed: " & objItem.IsSigned
Wscript.Echo "Manufacturer: " & objItem.Manufacturer
Wscript.Echo "PDO: " & objItem.PDO
Wscript.Echo "Signer: " & objItem.Signer
Wscript.Echo
Next

Function WMIDateStringToDate(dtmWMIDate)
If Not IsNull(dtmWMIDate) Then
WMIDateStringToDate = CDate(Mid(dtmWMIDate, 5, 2) & "/" & _
Mid(dtmWMIDate, 7, 2) & "/" & Left(dtmWMIDate, 4) _
& " " & Mid (dtmWMIDate, 9, 2) & ":" & _
Mid(dtmWMIDate, 11, 2) & ":" & Mid(dtmWMIDate, _
13, 2))
End If
End Function

//------------------------------------
Regards,
Vassiliev V. V.
http://www-sharp.com - best scripting/HTA IDE
 
Dr John Stockton said:
JRS: In article <#[email protected]>, seen in
Viatcheslav V. Vassiliev



No doubt there is little chance of getting Microsoft to spell "centre"

LOL - from Canada, where Lieutenant is pronounced "LEFTenant", and where we
still honoUr the English roots of spelling.
as it should be spelt, but they should be able to get "Compatability"
right. I don't know whether or not to hope that you've misquoted them.

Some people are just not ible to do this, partly because of incorrect
inferences that are easy to draw. I often have to question my own spelling
of the word because the -ability suffix seems to be logically related to the
root word "able". I am not sure what the actual "ability" or "ableness" that
a concept of "compatability" would refer to, but it sometimes seems less
foreign than the concepts of "ibility" or "ibleness". ;-)

I know, I know, good spelling and grammar means we should get it right even
in those cases where there are exceptions.

/Al
 
I don't know whether or not to hope that you've misquoted them.

I used copy and paste.

//------------------------------------
Regards,
Vassiliev V. V.
http://www-sharp.com - best scripting/HTA IDE
 
Back
Top