ChDrive Statement

Changes the current drive.

Syntax

ChDrive drive

Remarks

The required argument drive is a string specifying an existing drive. If the string is empty (""), current drive doesn't change. If drive contains more than one symbol, only the first symbol will be used by ChDrive.
On the Macintosh ChDrive also sets current folder to the root folder of the specified drive.

Example

In the example below the ChDrive statement is used to change the current drive.

' In Microsoft Windows:
ChDrive "D" ' Makes drive "D" current.

' On the Macintosh:
' Makes the drive "MY DRIVE" current.
ChDrive "MY DRIVE:"

' Makes drive "MY DRIVE" current. Current folder will be  
' the root folder of the drive.
ChDrive "MY DRIVE:MY FOLDER"

 

See Also

ChDir Statement, MkDir Statement , RmDir Statement, CurDir Function