Hi,

There are some good extensive samples or components that make software and hardware inventory with WMI easy

I'm seeking some examples or WMI class/property listing to catch the components in the machine that mades up a good software/hardware inventory.

Regards
Lucas Ponzo

Re: Software and Hardware Inventory by Ken

Ken
Thu May 06 06:51:16 CDT 2004

Hi,

Add a reference to system.management.dll

Private Sub GetDevices()
Dim moReturn As Management.ManagementObjectCollection
Dim moSearch As Management.ManagementObjectSearcher
Dim mo As Management.ManagementObject

moSearch = New Management.ManagementObjectSearcher("Select * from
Win32_PnPEntity")

moReturn = moSearch.Get
For Each mo In moReturn
Dim strOut As String
strOut = String.Format("{0} - Status {1}", mo("Name").ToString,
mo("Status").ToString)
Trace.WriteLine(strOut)
Next
End Sub

Private Sub GetInstalledSoftware()
Dim moReturn As Management.ManagementObjectCollection
Dim moSearch As Management.ManagementObjectSearcher
Dim mo As Management.ManagementObject

moSearch = New Management.ManagementObjectSearcher("Select * from
Win32_SoftwareFeature")

moReturn = moSearch.Get
For Each mo In moReturn
Dim strOut As String
strOut = String.Format("{0} - {1}", mo("productName").ToString,
mo("Vendor").ToString)
Trace.WriteLine(strOut)
Next
End Sub

Ken
----------------------
"Lucas Ponzo" <lucasponzo@nospam.nospam> wrote in message
news:6C2A006B-6DF5-44F4-9F47-D043BAC43B63@microsoft.com...
> Hi,
>
> There are some good extensive samples or components that make software and
> hardware inventory with WMI easy ?
>
> I'm seeking some examples or WMI class/property listing to catch the
> components in the machine that mades up a good software/hardware
> inventory.
>
> Regards,
> Lucas Ponzo.
>



Re: Software and Hardware Inventory by lucasponzo

lucasponzo
Thu May 06 10:56:04 CDT 2004


Thanks,

Very usefull this sample code. But more one question:

I search the documentation of the ManagementObjectSearcher and didn't saw the complete list of the "tables" that I can select from it. Win32_SoftwareFeature, Win32_PnPEntity ... etc ...

Can you indicate me in what documentation can I find it ?

Thanks
Lucas Ponzo.