OPENING AN APPLICATION(PROCESS) IN C#







It is very simple to execute an ‘exe’ file using C#.NET. Here all we need is to ‘start the process’ like below.

System.Diagnostics.Process.Start("notepad");

The above code will open notepad.

To open a file in notepad, just mention the filename as argument like below.

System.Diagnostics.Process.Start("notepad",@"c:\myFile.txt");

This will open the file “myFile.txt” in Notepad.

Try any other applications by specifying the full path name of the exe file instead of “notepad” like below.

System.Diagnostics.Process.Start(@"C:\Windows\explorer.exe");

Comments