-2

How can I open a software if I know the name of software?

Process word = new Process();
word.StartInfo.FileName = "winword.exe";
word.Start();

Expectation is the above code will open Microsoft word. But the issue is I need the name of exe (winword for above code). How can open any software enter by user's like If user enter photoshop then it will open photoshop on button click. I want to find name of exe programtically. Please Help me on this. Any idea will be appreciated. Thanks.

Srusti Thakkar
  • 1,835
  • 2
  • 22
  • 52

1 Answers1

0

You could start an application only by its name when the location of this file is included on the PATH variable. If you want to open another application you have to specify the full path.

I recommend to you adding the location on the PATH variable

This is a link of how to add a directory to path http://www.computerhope.com/issues/ch000549.htm

jcvegan
  • 3,111
  • 9
  • 43
  • 66
  • how can I get the full path if that application is run on another user's pc can you give me some demo code for storing dynamically path? – Kirtan Vaghela Aug 08 '15 at 14:45
  • how can I get the full path if that application is run on another user's pc can you give me some demo code for storing dynamically path? – Kirtan Vaghela Aug 10 '15 at 07:01
  • Take a look to this answer. Maybe you found util: http://stackoverflow.com/questions/909910/how-to-find-the-execution-path-of-a-installed-software – jcvegan Aug 10 '15 at 14:53