NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Process.StartInfo

Gets or sets the parameters to pass into the Start method for the Process.

[Visual Basic]
Public Property StartInfo As ProcessStartInfo
[C#]
public ProcessStartInfo StartInfo {get; set;}
[C++]
public: __property ProcessStartInfo* get_StartInfo();
public: __property void set_StartInfo(ProcessStartInfo*);
[JScript]
public function get StartInfo() : ProcessStartInfo;
public function set StartInfo(ProcessStartInfo);

Property Value

The ProcessStartInfo that represent the arguments with which to start the process. These arguments include the name of the file to be associated with the process.

Exceptions

Exception Type Condition
ArgumentException The value that specifies the StartInfo is a null reference (in Visual Basic Nothing).

Remarks

StartInfo represents the set of parameters necessary to start a process. When Start is called, the StartInfo is used to specify the process to start. StartInfo gives you the means to call Start on an existing Process component.

The only necessary StartInfo member to set is the FileName. The behavior of a process started by specifying its FileName is similar to typing the information into the Run dialog box of the Start menu. Therefore, the FileName does not need to be an executable. It can be any file type whose extension has been associated with an application installed on the system, for example ".txt" if you have associated text files with an editor like Notepad, or ".doc" if you have .doc files associated with a word processing tool like Microsoft Word. Similarly, in the same way that the Run dialog box can accept an executable name with or without the extension, the extension is optional as well in the FileName member. For example, you can set the FileName to either "Notepad.exe" or "Notepad".

If the FileName involves a nonexecutable file, like a .doc file, you can include verbs specifying what action to take on the file. For example you could set the Verb to "Print" for a file ending in the .doc extension.

When the process is started, the FileName is the file that populates the (read-only) MainModule property. If you want to retrieve the executable associated with the process after it has started, use the MainModule property. If you want to set the executable on a Process instance for which an associated process has not been started, use the StartInfo property's FileName member. Because the members associated with the StartInfo property are arguments that are passed into the Start method for a process, changing the FileName property after the associated process has been started will not reset the MainModule property. These properties are only used to initialize the associated process.

See Also

Process Class | Process Members | System.Diagnostics Namespace | Start | FileName