CurDir Function

Description

Returns the current path.

Syntax

CurDir[(drive)]

The drive argument is a string 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.

See Also

ChDir Statement, ChDrive Statement, MkDir Statement, RmDir Statement.

Example

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.= CurDir    ' Returns "C:\WINDOWS\SYSTEM".= CurDir("C")    ' Returns "C:\WINDOWS\SYSTEM".= CurDir("D")    ' Returns "D:\EXCEL".