Could be because they were not installed via Windows
installer?

from
http://msdn2.microsoft.com/en-us/library/aa394378(VS.85).aspx

"The Win32_Product WMI class represents products as
they are installed by 
Windows Installer. "

http://www.microsoft.com.nsatc.net/technet/scriptcenter/guide/sas_cpm_dgls.mspx

"The WMI Win32_Product class enables you to enumerate
the software installed on 
a computer, provided the software was installed by
using the Windows Installer."

Maybe enumerating the registry uninstall branch makes
more sense?

http://www.motobit.com/help/RegEdit/sa115.htm


Thane Sherrington wrote:
> 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
> 
> 
> 


      
____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 

Reply via email to