FileSystem.CurDir Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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() |
Returns a string representing the current path. The FileSystem gives you better productivity and performance in file I/O operations than |
CurDir(Char) |
Returns a string representing the current path. The FileSystem gives you better productivity and performance in file I/O operations than |
- 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
.NET 10 and other versions
Product | Versions |
---|---|
.NET | Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
- 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
.NET 10 and other versions
Product | Versions |
---|---|
.NET | Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: