Edit

Share via


FileSystem.CurDir Method

Definition

Returns a string representing the current path. The FileSystem gives you better productivity and performance in file I/O operations than CurDir. For more information, see CurrentDirectory.

Overloads

CurDir()

Returns a string representing the current path. The FileSystem gives you better productivity and performance in file I/O operations than CurDir. For more information, see CurrentDirectory.

CurDir(Char)

Returns a string representing the current path. The FileSystem gives you better productivity and performance in file I/O operations than CurDir. For more information, see CurrentDirectory.

CurDir()

Source:
FileSystem.vb
Source:
FileSystem.vb
Source:
FileSystem.vb

Returns a string representing the current path. The FileSystem gives you better productivity and performance in file I/O operations than CurDir. For more information, see CurrentDirectory.

public:
 static System::String ^ CurDir();
public static string CurDir ();
static member CurDir : unit -> string
Public Function CurDir () As String

Returns

A string representing the current path.

Examples

This example uses the CurDir function to return the current path.

' Assume current path on C drive is "C:\WINDOWS\SYSTEM".
' Assume current path on D drive is "D:\EXCEL".
' Assume C is the current drive.
Dim MyPath As String
MyPath = CurDir()   ' Returns "C:\WINDOWS\SYSTEM".
MyPath = CurDir("C"c)   ' Returns "C:\WINDOWS\SYSTEM".
MyPath = CurDir("D"c)   ' Returns "D:\EXCEL".

See also

Applies to

CurDir(Char)

Source:
FileSystem.vb
Source:
FileSystem.vb
Source:
FileSystem.vb

Returns a string representing the current path. The FileSystem gives you better productivity and performance in file I/O operations than CurDir. For more information, see CurrentDirectory.

public:
 static System::String ^ CurDir(char Drive);
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public static string CurDir (char Drive);
public static string CurDir (char Drive);
[<System.Runtime.Versioning.SupportedOSPlatform("windows")>]
static member CurDir : char -> string
static member CurDir : char -> string
Public Function CurDir (Drive As Char) As String

Parameters

Drive
Char

Optional. Char expression that specifies an existing drive. If no drive is specified, or if Drive is a zero-length string (""), CurDir returns the path for the current drive.

Returns

A string representing the current path.

Attributes

Examples

This example uses the CurDir function to return the current path.

' Assume current path on C drive is "C:\WINDOWS\SYSTEM".
' Assume current path on D drive is "D:\EXCEL".
' Assume C is the current drive.
Dim MyPath As String
MyPath = CurDir()   ' Returns "C:\WINDOWS\SYSTEM".
MyPath = CurDir("C"c)   ' Returns "C:\WINDOWS\SYSTEM".
MyPath = CurDir("D"c)   ' Returns "D:\EXCEL".

See also

Applies to