Skip to content

Instantly share code, notes, and snippets.

@polarnik
Last active August 29, 2015 14:12
Show Gist options
  • Save polarnik/534ca88234db2f7c786a to your computer and use it in GitHub Desktop.
Save polarnik/534ca88234db2f7c786a to your computer and use it in GitHub Desktop.
Get installed products, VBS, WMI
Set FSO = CreateObject("Scripting.FileSystemObject")
Set Report=FSO.CreateTextFile("getProducts.txt") 'report file
strComputer = "." 'local computer
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
For Each objProduct in objWMIService.InstancesOf("Win32_Product")
echoStr = objProduct.AssignmentType & vbTab & _
objProduct.Caption & vbTab & _
objProduct.Description & vbTab & _
objProduct.IdentifyingNumber & vbTab & _
objProduct.InstallDate & vbTab & _
objProduct.InstallLocation & vbTab & _
objProduct.InstallState & vbTab & _
objProduct.HelpLink & vbTab & _
objProduct.HelpTelephone & vbTab & _
objProduct.InstallSource & vbTab & _
objProduct.Language & vbTab & _
objProduct.LocalPackage & vbTab & _
objProduct.Name & vbTab & _
objProduct.PackageCache & vbTab & _
objProduct.PackageCode & vbTab & _
objProduct.PackageName & vbTab & _
objProduct.ProductID & vbTab & _
objProduct.RegOwner & vbTab & _
objProduct.RegCompany & vbTab & _
objProduct.SKUNumber & vbTab & _
objProduct.Transforms & vbTab & _
objProduct.URLInfoAbout & vbTab & _
objProduct.URLUpdateInfo & vbTab & _
objProduct.Vendor & vbTab & _
objProduct.WordCount & vbTab & _
objProduct.Version
'Wscript.Echo echoStr 'uncomment if run in console: cscript getProducts.vbs
Report.WriteLine(echoStr)
Next
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment