1. Home
  2. %CD directive

%CD directive

Changes current directory, PC Windows only.

No options

Parameters

DIRECTORY = text Directory to change to
CURRENT = text Saves new directory

Description

The %CD directive can be used to change directory under Windows or DOS. The DIRECTORY specifies the directory as a text containing either the absolute or relative pathname, for example 'C:/CONSULT/DATA' or '../../PROJECT'.

Note that a forward slash (/) may be used as a directory separator character, as the backwards slash ( \ ) is the Genstat continuation character and would have to be doubled up. Environment variables may be used in the path name, for example '%TEMP%/temp.out', and %GENDIR% can be used to specify the Genstat root directory (eg. C:).

The CURRENT parameter saves the new directory name. You can obtain the name of the current directory by typing the command

%CD '.'; CURRENT=curdirwhich will set up curdir as a text containing the current directory name.

See also

Directive: SUSPEND.
Procedure: DIRECTORY.
Commands for: Program control.

Updated on February 7, 2023

Was this article helpful?