Is installed?

  • Thread starter Thread starter Tim Marsden
  • Start date Start date
T

Tim Marsden

Hi,

How do I tell ( in vb.net code ) if a certain program is installed e.g.
outlook, excel, word etc.

regards
Tim
 
Add a reference to system.management. Not all apps report the
Install location.

Dim moReturn As Management.ManagementObjectCollection

Dim moSearch As Management.ManagementObjectSearcher

Dim mo As Management.ManagementObject

moSearch = New Management.ManagementObjectSearcher("Select * from
Win32_Product")

moReturn = moSearch.Get

For Each mo In moReturn

Debug.WriteLine(String.Format("{0} Location {1} ", mo("Name"),
mo("InstallLocation")))

Next

If the string = your exe path exit the loop and life is good.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top