Table of contents
TOC
Collapse the table of content
Expand the table of content

ChDrive Statement

office 365 dev account|Last Updated: 6/12/2017
|
1 Contributor

Changes the current drive.

Syntax

ChDrivedrive

The required driveargument is astring expression that specifies an existing drive. If you supply a zero-length string (""), the current drive doesn't change. If the drive argument is a multiple-character string, ChDrive uses only the first letter. On the Macintosh, ChDrive changes the current folder to the root folder of the specified drive.

Example

This example uses the ChDrive statement to change the current drive. On the Macintosh, "HD:" is the default drive name and ChDrive would change the current folder to the root folder of the specified drive. The following example assumes the machine actually has a drive named D.

ChDrive "D" ' Make "D" the current drive. 
© 2017 Microsoft