Export (0) Print
Expand All

Process.ProcessName Property

Gets the name of the process.

[Visual Basic]
Public ReadOnly Property ProcessName As String
[C#]
public string ProcessName {get;}
[C++]
public: __property String* get_ProcessName();
[JScript]
public function get ProcessName() : String;

Property Value

The name that the system uses to identify the process to the user.

Exceptions

Exception Type Condition
SystemException The process does not have an identifier, or no process is associated with the Process.

-or-

The associated process has exited.

Remarks

The ProcessName property holds an executable file name, such as Outlook, that does not include the .exe extension or the path. It is helpful for getting and manipulating all the processes that are associated with the same executable file.

Note   The ProcessName property holds up to fifteen characters.

You can call GetProcessesByName, passing it an executable file name, to retrieve an array that contains every running instance on the specified computer. You can use this array, for example, to shut down all the running instances of the executable file.

Windows 98 Platform Note:  This property is not available on this platform if you started the process with ProcessStartInfo.UseShellExecute set to true.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

.NET Framework Security: 

See Also

Process Class | Process Members | System.Diagnostics Namespace | GetProcessesByName

Show:
© 2014 Microsoft