ChDrive Command

Purpose

Sets the current drive.

Syntax

ChDrive n or n$

n:integer expression
n$:sexp

Description

ChDrive (change drive) sets the current drive. If an input or output command does not contain a drive, all inputs and outputs default to the current drive. n can assume the values from 1 to 16, and these values correspond to drives A to P. Instead of a drive number, ChDrive can also take a string whose first character is the drive letter.

Example

ChDrive 1     // Drive A is the current drive

ChDir "\Test" // A:\Test

ChDir "A1"    // A:\Test\A1

ChDir "..\A2" // A:\Test\A2

Remarks

ChDrive and _Drive should be used with much care, because through the increasing use of network drives other notations are used as well. For instance ..//Hallo\.. etc).

See Also

_Drive

{Created by Sjouke Hamstra; Last updated: 26/09/2014 by James Gaite}