ProcessStartInfo.WorkingDirectory Property

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

Namespace: System.Diagnostics
Assembly: System (in system.dll)

public string WorkingDirectory { get; set; }
/** @property */
public String get_WorkingDirectory ()

/** @property */
public void set_WorkingDirectory (String value)

public function get WorkingDirectory () : String

public function set WorkingDirectory (value : String)

Property Value

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


   The WorkingDirectory property must be set if UserName and Password are provided. If the property is not set, the default working directory is %SYSTEMROOT%\system32.

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.

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 2.0

Community Additions