I am saving files (images, Excel doc, Word doc, exe files, bat files and so on). I need to execute the file from inside my program and the question is if there is a way to let Windows handle how to run/execute the file? Like when you double click on a file in Explorer?
Asked
Active
Viewed 2,949 times
2 Answers
13
Take a look at the Process.Start method:
System.Diagnostics.Process.Start(myFileName)
Note: this will work with any registered file-extension, for example
System.Diagnostics.Process.Start(@"c:\Image.bmp")
will open the image with the registered program.

Random Dev
- 51,810
- 9
- 92
- 119
3
Start new process with the saved file path name as a parameter:
System.Diagnostics.Process.Start(pathToYourFile);

Karel Frajták
- 4,389
- 1
- 23
- 34