Skip to content

Latest commit

 

History

History
40 lines (25 loc) · 1.25 KB

chdrive-statement.md

File metadata and controls

40 lines (25 loc) · 1.25 KB
title keywords f1_keywords ms.assetid ms.date ms.localizationpriority
ChDrive statement (VBA)
vblr6.chm1008865
vblr6.chm1008865
b07d5925-fba0-9a50-8197-c782fda0bee5
12/03/2018
medium

ChDrive statement

Changes the current drive.

Syntax

ChDrive drive

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

See also

[!includeSupport and feedback]