How in c# can I make a file open with a specified program ie: not the default program for that file type
3 Answers
If you can build a command-line to run the program (including passing the input file as a command-line parameter) than build the command line ans use Process.Start
.
Of course this assumes
- you know the path to the program's executable
- you know how to pass the filename as a command-line parameter.
How 2. works depends on the program. It could be as simple as
Process.Start("MyProgram.exe","MyFile.dat")
But other programs may require a command-line switch or other information.

- 149,601
- 11
- 178
- 240
-
-
12) depends on the program. Read it's docs or search for the program name in the registry to get the start options. – D Stanley Mar 04 '13 at 21:31
You can use the System.Diagnostics.Process(String, String)
method that you can find further documentation here
Sample:
// Start a Web page using a browser associated with .html and .asp files.
Process.Start("IExplore.exe", "C:\\myPath\\myFile.htm");
For future posts, I suggest you post code that you have already attempted/written to help us better help you.

- 1,555
- 4
- 18
- 39
All the answers I found on the internet say that you can just use Process.Start("MyProgram.exe")
but I always get an exception that the file is not found so I got it working by specifying the full path to the .exe file in the installation folder
Process.Start(@"C:\Program Files\Google\Chrome\Application\chrome.exe")
you can find the installation folder by clicking on the right mouse button on a shortcut in the desktop and press Open file location
.

- 43
- 1
- 7