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]
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:
- 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#).
- 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).
- Maybe another possible solution is just letting users browse through their start menu shortcuts, and launching them.
Amitay Dobo
2010-03-04 03:47:43