VB6Runtime / Library / File / curdir

VB6 Library Reference

CurDir Function

Returns a String representing the current path for the specified drive or the default drive.

Syntax

CurDir[(drive)]

Parameters

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

Reference

← Back to File | View all functions