Returns a string representing the current path.
Public Overloads Function CurDir([ ByVal Drive As Char ]) As String
| Exception type | Error number | Condition |
|---|---|---|
| 68 | Drive is not found. | |
| 68 | Invalid Drive is specified. |
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".
Namespace: Microsoft.VisualBasic
Module: FileSystem
Assembly: Microsoft Visual Basic .NET Runtime (in MicrosoftVisualBasic.dll)
ChDir Function | ChDrive Function | MkDir Function | RmDir Function |