This documentation is archived and is not being maintained.

Process Constructor

Initializes a new instance of the Process class.

Namespace:  System.Diagnostics
Assembly:  System (in System.dll)

public Process()

If you do not specify the MachineName property, the default is the local computer, (".").

You have two options for associating a new Process component with a process on the computer. The first option is to use the constructor to create the Process component, set the appropriate members of the StartInfo property and call Start to associate the Process with a new system process. The second option is to associate the Process with a running system process by using GetProcessById or one of the GetProcesses return values.

If you use a static overload of the Start method to start a new system process, the method creates a new Process component and associates it with the process.

When the ProcessStartInfo.UseShellExecute property is set to its default value, true, you can start applications and documents in a way that is similar to using the Run dialog box of the Windows Start menu. When ProcessStartInfo.UseShellExecute is false, you can start only executables.

Any executable file that you can call from the command line can be started in one of two ways: by setting the appropriate members of the StartInfo property and calling the Start method with no parameters, or by passing the appropriate parameter to the static Start member.

You can create a Process component by using the constructor, one of the static Start overloads, or any of the GetProcessById, GetProcesses, or GetProcessesByName methods. After you have done so, you have a view into the associated process. This is not a dynamic view that updates itself automatically when the process properties have changed in memory. Instead, you must call Refresh for the component to update the Process property information in your application.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

  • LinkDemand 

    for full trust for the immediate caller. This member cannot be used by partially trusted code.

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.