Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

ProcessStartInfo.WorkingDirectory Property

Gets or sets the initial directory for the process to be started.

[Visual Basic]
Public Property WorkingDirectory As String
[C#]
public string WorkingDirectory {get; set;}
[C++]
public: __property String* get_WorkingDirectory();
public: __property void set_WorkingDirectory(String*);
[JScript]
public function get WorkingDirectory() : String;
public function set WorkingDirectory(String);

Property Value

The fully qualified name of the directory that contains the process to be started. The default is an empty string ("").

Remarks

If the directory is already part of the system path variable, it is not necessary to repeat the directory's location in this property.

The WorkingDirectory property behaves differently when UseShellExecute is true than when UseShellExecute is false. When UseShellExecute is true, the WorkingDirectory property specifies the location of the executable. If WorkingDirectory is an empty string, the current directory is understood to contain the executable.

When UseShellExecute is false, the WorkingDirectory property is not used to find the executable. Instead, it is used by the process that is launched and only has meaning within the context of the new process.

Requirements

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

See Also

ProcessStartInfo Class | ProcessStartInfo Members | System.Diagnostics Namespace

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.