Forum Discussion

MulgraveTester's avatar
Frequent Contributor
8 years ago

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?

4 Replies

    • MulgraveTester's avatar
      Frequent Contributor

      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?