Wednesday, August 19, 2009

Enumerating Installed Software information

Enumerating Installed Software information:

Option Explicit
On error resume next

dim strComputer,objWMIService,colFeatures,objFeature
strComputer = "."

Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colFeatures = objWMIService.ExecQuery _
("Select * from Win32_SoftwareFeature")

For Each objFeature in colfeatures
Msgbox "Software Name: " & objFeature.Name
Msgbox "Accesses: " & objFeature.Accesses
Msgbox "Attributes: " & objFeature.Attributes
Msgbox "Caption: " & objFeature.Caption
Msgbox "Description: " & objFeature.Description
Msgbox "Identifying Number: " & objFeature.IdentifyingNumber
Msgbox "Install Date: " & objFeature.InstallDate
Msgbox "Install State: " & objFeature.InstallState
Msgbox "Last Use: " & objFeature.LastUse
Msgbox "Product Name: " & objFeature.ProductName
Msgbox "Vendor: " & objFeature.Vendor
Msgbox "Version: " & objFeature.Version
Next

No comments: