views:

219

answers:

2

How can I execute an external program like an exe file? I want to get a list of installed programs, and then execute them on selection. If you are wondering why I need this, I am updating a scheduler application to provide a feature so that users can open a program on notification. For example, the notification would say, "... starts in ... Do you want to open ...?" [Yes] [No]

+7  A: 

You can use Process.Start to execute an external application.

Reed Copsey
A: 

As mentioned, you can simply execute by Process.Start. However, getting the list of of installed programs can be more tricky. Some entry points for alternatives you can start looking into:

  1. Using Windows installer to enumerate installed products. You will need to import the MSI calls calls so you can use them from managed code (i.e. C#).
  2. Look for registered applications in the registry. Note that nothing forces an application to be listed there (it's true for using Windows installer true).
  3. Maybe another possible solution is just letting users browse through their start menu shortcuts, and launching them.
Amitay Dobo