Ask a Question

Identify if product is installed

Frequent Contributor

Identify if product is installed

My tested program now comes in 3 variants so I need to load different data depending on the variant of the product installed.

Only one variant can be installed at a time, so I want to see which variant is installed before stating my test.

Using VBScript how can I get the name of installed programs and test which of my three variants is installed?

Community Hero

It's an old article, but looks like it should be useful for what you want ....


(PS ... was the first result in a google search for "vbscript check installed programs" Smiley Wink )

I've written this


sub checkInstall
  Set WmiService = GetObject ("WinMgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")

  Set colSoftware = WmiService.ExecQuery ("Select * from Win32_Product") 

  for each softwareItem in colSoftware
    log.message("Name (" & & ") and Version (" & softwareItem.version & ") and Vendor (" & softwareItem.vendor & ")")

end sub


which lists all software installed by a Windows installer but it does not list all products installed and the product I am testing in particular. How do I get a complete list of software installed - as shown in Programs and Features?

Is it a 64 bit machine? (And a 64 bit install you're searching for)


Just wondering if:


("Select * from Win32_Product") 


...  is not catching a 64 bit installs?


Here's an alternative from MS that uses the registry.

Thanks Colin, The registry search solution worked for me. Here is my simplified version (Where you see the emoticon it should be ":" then "S". I couldn't see how to turn off emoticons.)


sub checkInstallReg
  Const HKLM = &H80000002 'HKEY_LOCAL_MACHINE
  strComputer = "."
  strKey = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"
  Set objReg = GetObject("winmgmts://" & strComputer & "/root/default:StdRegProv")
  objReg.EnumKey HKLM, strKey, arrSubkeys

  For Each strSubkey In arrSubkeys
    objReg.GetStringValue HKLM, strKey & strSubkey, "DisplayName", strSoftwareName
    objReg.GetStringValue HKLM, strKey & strSubkey, "InstallDate", strInstalledDate
    objReg.GetStringValue HKLM, strKey & strSubkey, "DisplayVersion", strDisplayVersion   
    log.Message("Name (" & strSoftwareName & ") Version (" & strDisplayVersion & ") Installed on (" & strInstalledDate & ")")  

end sub

Showing results for 
Search instead for 
Did you mean: