Siebel VB Language Reference > VB Language Reference >

CurDir Function


This standard VB function returns the default folder (and drive) for the specified drive.

Syntax

CurDir[$][(drive)]

Argument
Description

drive

The letter of the drive to search

Returns

The default drive and folder.

Usage

A colon is not required after the drive name. The drive must exist, and must be within the range specified in the LASTDRIVE statement of the config.sys file. If a null argument ("") is supplied, or if no drive is indicated, the path for the default drive is returned.

The dollar sign ($) in the function name is optional. If it is included, the return type is string. Otherwise the function returns a variant of vartype 8 (string).

To change the current drive, use ChDrive. To change the current folder, use ChDir.

Example

This example changes the current folder to C:\Windows, if it is not already the default.

Sub Button_Click
   Dim newdir as String
   newdir = "c:\Windows"
   If CurDir  <>  newdir then
      ChDir newdir
   End If
End Sub

See Also

ChDir Statement
ChDrive Statement
Dir Function
MkDir Statement
RmDir Statement

Siebel VB Language Reference