System.Diagnostics.ProcessStartInfo.FileName Property

Gets or sets the application or document to start.

Syntax

[System.ComponentModel.DefaultValue("")]
[System.ComponentModel.Editor("System.Diagnostics.Design.StartFileNameEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.Drawing.Design.UITypeEditor, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
[System.ComponentModel.NotifyParentProperty(true)]
[System.ComponentModel.RecommendedAsConfigurable(true)]
[System.ComponentModel.TypeConverter("System.Diagnostics.Design.StringValueConverter, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
[System.Diagnostics.MonitoringDescription("The name of the resource to start this process.")]
public string FileName { get; set; }

Value

Path to the application to be executed.

Remarks

You must set at least the ProcessStartInfo.FileName property before you start the process. The file name is any application or document. A document is defined to be any file type that has an open or default action associated with it. You can view registered file types and their associated applications for your computer by using the Folder Options dialog box, which is available through the operating system. The Advanced button leads to a dialog box that shows whether there is an open action associated with a specific registered file type.

The set of file types available to you depends in part on the value of the ProcessStartInfo.UseShellExecute property. If ProcessStartInfo.UseShellExecute is true, you can start any document and perform operations on the file, such as printing, with the System.Diagnostics.Process component. When ProcessStartInfo.UseShellExecute is false, you can start only executables with the System.Diagnostics.Process component.

You can start a ClickOnce application by setting the ProcessStartInfo.FileName property to the location (for example, a Web address) from which you originally installed the application. Do not start a ClickOnce application by specifying its installed location on your hard disk.

Requirements

Namespace: System.Diagnostics
Assembly: System (in System.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0