I'm trying to get a list of the software installed on an XP machine
so that I programmatically check to see if there are multiple AVs
running. I'm using the code below (which I found on the net) but it
only lists a subset of the the software installed. What am I doing wrong?
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.CreateTextFile("software.tsv", True)
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colSoftware = objWMIService.ExecQuery _
("SELECT * FROM Win32_Product")
objTextFile.WriteLine "Name" & vbtab & vbtab & vbtab & vbtab & vbtab
& "Vendor" & vbtab & vbtab & vbtab & vbtab & "Version"
For Each objSoftware in colSoftware
LineToWrite=objSoftware.Name
NumberOfTabs=Round((36-len(objSoftware.Name)) /8)+1
for i=1 to NumberOfTabs
LineToWrite=LineToWrite&vbtab
next
LineToWrite=LineToWrite&objSoftware.Vendor
NumberOfTabs=Round((36-len(objSoftware.Vendor)) /8)
for i=1 to NumberOfTabs
LineToWrite=LineToWrite&vbtab
next
LineToWrite=LineToWrite&objSoftware.Version
objTextFile.WriteLine LinetoWrite
Next
objTextFile.Close
T