CHDIR
This page was last modified 12:32, 1 June 2020 by Gdx. Based on work by Mars2000you.

Contents

Effect

Displays or changes the current working directory.

Each drive has its own current directory. This remains at the directory specified by the last CHDIR instruction for that drive (or at the root directory initially) until another CHDIR instruction is given or it cannot be found on the disk when it is accessed (because the disk has been changed, for example). It is then returned to the root directory.

This command works with MSX-DOS 2, as provided by the MSX-DOS 2 cartridge or the MSX Turbo R machines, with a MSX-DOS 2 disk in the current active drive. It is also supported by Nextor.

Note: The command prompt can be changed to display the current directory with the command SET PROMPT ON.

Syntaxes

  • CHDIR <Device>:\<Path>\
  • CHDIR ..
  • CHDIR .

Notes:

  • CHDIR can be replaced by CD
  • Character backslash (\) serves as a separator between the folders and the file name in MSX-DOS2. You don't have to put it after the colon of the device name. Backslash is replaced by the character yen (¥) on Japanese MSX or the character won (₩) on Korean MSX.
  • Wildcards can not be used.

Parameters

<Device> is the name for used device. It can only be a disk drive.

If you don't specify the drive, the command will be applied to the currently active drive (by default, it's drive A:)

Device type Device name Remark
Disk drive A, B, C, D, E, F, G, H A floppy disk interface can control until 2 drives.


<Path> is used to specify the location in folders of the new current folder.

If no path is specified, then the current directory path for the current or specified drive is displayed. This is the directory path from the root directory to the current directory.

\ used alone allows to display the root directory.

Dot (.) represents the current working directory, Dot Dot (..) represents the directory before the current (one level up).

Examples

A>CHDIR \GAMES
A>CHDIR B:\TEST\DATA\APP1
A>CD \
A>CD ..\APP2

Related to

ATDIR, CDPATH, CDPATH (Environment Variable), DIR, MKDIR, MVDIR, PROMPT (Environment Variable), RMDIR, RNDIR, SET

Compatibility

MSX-DOS 2 / Nextor with COMMAND2.COM v2.20 and higher