This documentation is archived and is not being maintained.

Code: Running a Program (Visual C#)

Visual Studio .NET 2003

This example loads and runs the MSPaint application using the Process.Start method.

Example

System.Diagnostics.Process.Start("mspaint.exe");

Compiling the Code

Copy the code and paste it into the Main method of a console application.

Replace "mspaint.exe" with the path to the application you want to run.

Robust Programming

The following conditions may cause an exception:

Security

The call to Process.Start requires full trust (SecurityException Class).

See Also

Process.Start Method | Starting Processes | General Language Example Topics

Show: