Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Plant SCADA

ChDrive

  • Last UpdatedJul 18, 2023
  • 1 minute read

Changes the system environment current drive to the specified drive.

The parameter Drv must be a string or expression that can represent a valid DOS file structure drive letter. The Drv may be local to the computer, or mapped from anywhere on the network connected to the computer. If Drv contains more than one letter, only the first character is used.

Note: The file system keeps track of the current drive, and the current directory of every drive. Use the CurDir, CurDir$ statement to determine the current directory. The current drive letter can be extracted from the Left character returned in the CurDir statement.

The ChDrive statement changes the current drive but not the current directory on any drive. To change the current directory, use the ChDir statement.

Syntax

ChDriveDrv

Drv:

A string or expression that can represent a valid DOS file structure drive letter. Drv is case insensitive and must end with a colon (:). The Drv may be local to the computer, or mapped from anywhere on the network connected to the computer. Drv is often included as part of the Path parameter.

ChDir | CurDir, CurDir$ | Dir | RmDir | MkDir

Example

Dim strCurPath as String
strCurPath = CurDir$()' store current path as string
ChDir "\"' change to root directory of current drive
<statements>' do stuff in root directory
ChDrive "C"' change to C drive (if not already there)
<statements>' do stuff in current directory on C drive
ChDrive strCurPath' change back to previous drive
ChDir strCurPath' change back to previous path

In This Topic
Related Links
TitleResults for “How to create a CRG?”Also Available in