CurDir Function
Returns a String representing the current path for the specified drive or the default drive.
Syntax
CurDir[(drive)]
Parameters
drive: Optional.Stringexpression that specifies an existing drive. If no drive is specified or if drive is a zero-length string (""),CurDirreturns the path for the current drive. The drive parameter can be just the drive letter (e.g., "C") or include a colon (e.g., "C:").
Return Value
Returns a String containing the current directory path for the specified drive. The returned
path does not include a trailing backslash unless the current directory is the root directory.
Examples
Dim currentDir As String
currentDir = CurDir() ' Current drive
Dim cDrive As String
cDrive = CurDir("C") ' Drive C
Dim dDrive As String
dDrive = CurDir("D:") ' Drive D