Share via


Directory.SetCurrentDirectory Method

Sets the application's current working directory to the specified directory.

Namespace: System.IO
Assembly: mscorlib (in mscorlib.dll)

Syntax

public static void SetCurrentDirectory (
         stringpath
)

Parameters

  • path
    The path to which the current working directory is set.

Remarks

When the application terminates, the working directory is restored to its original location (the directory where the process was started).

The path parameter is permitted to specify relative or absolute path information. Relative path information is interpreted as relative to the current working directory. To obtain the current working directory, see GetCurrentDirectory.

The path parameter is not case-sensitive.

Version Information

Available in the .NET Micro Framework versions 3.0, 4.0, and 4.1.

See Also

Reference

Directory Class
Directory Members
System.IO Namespace