4

I'm in trouble with this problem. I must list all installed programs on Windows OS (both x86 and x64), including Internet Explorer and other Windows components.

I tried some solutions:

  1. Using WMI with query "SELECT * FROM Win32_Product", but the result does not have Internet Explorer, and on x64, it does not list all programs.

  2. Read registry: I try to read: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall on x86, but IE is not listed.

Summary, I need to list all installed programs and windows components (like IE) on both x86 and x64 OS.

Can anyone help me? Thank you very much.

usr1234567
  • 21,601
  • 16
  • 108
  • 128
William Truong
  • 237
  • 3
  • 12
  • 2
    Do you consider .exe's that aren't registered to be installed? There is still a mountain of software that is just "there", unknown to the registry. And don't forget to look inside cygwin and similar environments. Those unix programs in cygwin are still there even if they don't all have .exe filetypes. – Wes Miller Dec 02 '13 at 20:43

1 Answers1

1

Try this WMI query script and see if it also is missing your x64 stuff. If it does not then try again under a x64 command shell. I'm suspecting that you are executing your program in 32-bit mode:

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.CreateTextFile("c:\scripts\software.tsv", True)
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
 & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colSoftware = objWMIService.ExecQuery _
 ("SELECT * FROM Win32_Product")
objTextFile.WriteLine "Caption" & vbtab & _
"Description" & vbtab & "Identifying Number" & vbtab & _
"Install Date" & vbtab & "Install Location" & vbtab & _
"Install State" & vbtab & "Name" & vbtab & _
"Package Cache" & vbtab & "SKU Number" & vbtab & "Vendor" & vbtab _
 & "Version"
For Each objSoftware in colSoftware
 objTextFile.WriteLine objSoftware.Caption & vbtab & _
 objSoftware.Description & vbtab & _
 objSoftware.IdentifyingNumber & vbtab & _
 objSoftware.InstallLocation & vbtab & _
 objSoftware.InstallState & vbtab & _
 objSoftware.Name & vbtab & _
 objSoftware.PackageCache & vbtab & _
 objSoftware.SKUNumber & vbtab & _
 objSoftware.Vendor & vbtab & _
 objSoftware.Version
Next
objTextFile.Close

Source: Enumerating Installed Software