This documentation is archived and is not being maintained.

ProcessStartInfo.WorkingDirectory Property

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

[Visual Basic]
Public Property WorkingDirectory As String
public string WorkingDirectory {get; set;}
public: __property String* get_WorkingDirectory();
public: __property void set_WorkingDirectory(String*);
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 ("").


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.


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