(typed by ag0ny@ag0ny.com from Roderik Muit's ASCII originals)
This chapter describes the user interface and commands provided by MSX-DOS 2 version 2.20.
MSX-DOS 2, like its predecessor MSX-DOS 1, is provided in a cartridge and in some disk files. The disk files are MSXDOS2.SYS, COMMAND2.COM, help files and transient commands.
MSXDOS2.SYS has the ability to load and execute programs in an enhanced CP/M-compatible environment. COMMAND2.COM is a special program which, when loaded and executed, provides the user with many sophisticated commands and features generally compatible with and in many cases better than those found in MS-DOS and MSX-DOS 1, such as extended memory management.
It also has the ability to load and execute specially written MSX-DOS 1 programs and most standard CP/M programs, and can execute batch files with parameter substitution and other features similar to those found in MS-DOS.
An APPEND facility is provided to increase the ease of use of directories with CP/M programs which were not written to handle them.
Throughout the rest of this manual the term MSX-DOS is used to mean MSX-DOS version 2.xx unless otherwise stated.
When typing in a command line to MSX-DOS, a simple editing facility is available for correction of mistakes or the re-entering and editing of previous commands.
Typing ordinary characters at the keyboard cause the characters to appear on the screen as would be expected. Typing most control characters cause them to be represented by a '^' symbol followed by the control letter. Exceptions are carriage return (RET or CTRL-M), back space (BS or CTRL-H), tab (TAB or CTRL-I), insert (INS or CTRL-R), escape (ESC or CTRL-[), home (HOME or CTRL-K), CTRL-C, CTRL-J, CTRL-N, CTRL-P, CTRL-S, CTRL-U and CTRL-X (SELECT). These perform the following functions:
At any point whilst typing in a command line, the backspace key (marked BS or BACKSPACE on most MSX machines) can be used to delete the character immediately to the left of the cursor in the normal way.
The cursor left and right keys will move the cursor left and right along the line. Typing a character at this point will overwrite the character currently underneath the cursor.
Pressing the insert key (marked INS on most MSX machines) will toggle to 'insert mode', and the cursor will change to an underline cursor to indicate this. Instead of the characters being typed overwriting the characters under the cursor, they will instead be inserted before the cursor character, the remaining characters to the end of the line being moved one position to the right.
The delete key (marked DEL on most MSX machines) will delete the character under the cursor and move the remaining characters to the end of the line one position to the left.
The home key (marked 'HOME' on most MSX machines) will move the cursor to the start of the line.
Pressing ESC, CTRL-U or CTRL-X will clear the line to allow a new one to be entered.
The command editor also keeps a list of previous commands entered, up to a limit of 256 characters. Pressing the cursor up key will move up the list and display the previous command line entered, allowing this old command line to be edited and re-entered. Pressing the cursor down key will similarly move to the next old command line that was entered.
If a previous command line is changed, then it will be used as the new command line and added to the bottom of the list. If it was not changed, then it will not be added to the list and the current command line will be the next one which was originally entered. This allows a whole sequence of previous commands to be entered easily.
The list of previous commands is in fact circular and moving off the top or bottom will move to the last or first command in the list respectively. The previous command can be called to be re-entered or edited from this command history list.
The features described here are in fact available to many programs that MSX-DOS can execute. In any program that does 'line inputs', each line can be edited as described above. Previous lines can be recalled for re-entering and editing, although the list of previous lines will of course include previous commands.
The syntax of the commands available from MSX-DOS are described in section 1.4 using the following notation:
These are keywords and must be entered as shown in any mixture of upper or lower case.
These are parameters which must be supplied to the command at this point in the command line.
These are optional items. The brackets themselves should not be included in the command line.
This indicates that only one of the items is required. The vertical bar itself should not be included in the command line.
This indicates that a drive name is required (A:, B: etc.).
If d: is shown as optional and is not specified, then the currently logged-on drive, as indicated by the command prompt, is assumed.
This indicates that a directory path is required, the syntax of which is similar to MS-DOS. Each directory in the path is separated by a backslash '\'. A backslash at the start of the path indicates that the path starts at the root directory, otherwise the path starts at the current directory as indicated by the CHDIR command. Frequently a filename follows a path, in which case the two must be separated by a backslash.
Two consecutive dots '..' signify the immediate parent directory in the path. A single dot '.' signifies the current directory in the path and therefore usually has no value in a path specification.
On non-English MSX machines, the backslash character '\' may be replaced by some other character. In particular, on Japanese MSX machines the Yen character is used.
If a path is shown as optional and is not specified, then the current directory as indicated by the CHDIR command is assumed.
The syntax of the directory names that make up a path name follows that for filenames given below.
This indicates that the name of a file is required, the syntax of which is similar to MS-DOS and MSX-DOS 1. An ambiguous filename is one that contains '*' and '?' characters and may match more that one file on disk, whilst one that does not contain these is an unambiguous filename.
A filename has the following syntax:
The following characters cannot be used in filenames:
If a filename is shown as optional and is not specified, then a filename of *.* is assumed.
This is used to identify a file or several files in the same directory on a disk. It's syntax is:
Generally, d: if not given defaults to the currently logged on drive, path if not given defaults to the current directory of that drive and filename if not given defaults to a filename of *.*.
This is used in many commands to specify the files or directories to which the command is applied. It's syntax is:
Where a compound-filespec is used to specify existing files, /H may be given after each filespec (see above), in which case it will take effect only for the files matched by that single filespec. If a /H is given before the compound-filespec, then it will apply over all the filespecs.
This indicates that a volume name is required. A volume name is a sequence of up to 11 characters, which can include the characters not valid for filenames with the exception of control codes and '/', although leading spaces will be deleted.
This indicates one of the five standard MSX-DOS devices is required. These and their meaning are:
Device names can generally be used wherever filenames can be used. For example, the command COPY MYFILE PRN will read the file MYFILE and write it to the printer.
When using the CON device as an input filename, lines can be typed in and edited in the same way as command lines (see section 1.2on Editing Command Lines). To end the operation, CTRL-Z (^Z) must be typed at the start of a line. For example, a small text file called MYFILE can be created with the command COPY CON MYFILE:
If the NUL device is written to by the command COPY CON NUL, then the characters written are simply ignored. If read from, then an end-of-file condition is returned straight away (which is equivalent to typing the CTRL-Z in the example above).
For most commands, it is not sensible to specify a device (the CON device cannot be deleted using the ERASE command, for example). The commands that devices are likely to be used with are those that read and write data from and to files, such as CONCAT, COPY and TYPE.
This indicates that a number is required. This may be in the range 0 to 255 or 0 to 65535 depending on the command.
This chapter describes in detail all the commands available from the MSX-DOS CLI1.1. Each command is described using the notation described in section 1.3. Where two or more parameters are described using this notation, they must be separated by separators. Separators consist of zero or more leading spaces, a separator character, and zero or more trailing spaces. Valid separator characters are:
A transient MSX-DOS or CP/M-80 program can be loaded and executed by typing the main name of the filename plus an optional extension of .COM. Batch files can similarly be executed except that the extension is .BAT. Where COM and BAT files exist in the same directory and with the same name, the COM file is found and executed in preference to the BAT file. The exact location on disk of the command can be specified by including its drive and/or path with its name.
When looking for a COM or BAT file, the specified directory of the specified drive is searched. If not found and a drive or path was given with the command, then an 'unrecognized command' error results.
If just the filename and optional extension were given, the current directory is searched first. If not found, then a list of directories is searched. This list can be specified and changed using the PATH command. If still not found then an 'unrecognized command' error again results.
No CP/M program will be able to specify directories or path names since these do not exist in CP/M, only the current directory of the appropriate drive being accessible from these programs. An APPEND environment item is available which increases the usability of these programs by allowing an alternative directory to be searched by the program as well as the current one (see section 1.7 on Environment Items).
Many commands and programs perform input or output using the 'standard input' and 'standard output'. The standard input normally refers to the keyboard, and the standard output normally refers to the screen. These can be changed, however, to refer to other devices or to disk files for the duration of the command by including the redirection symbols <, > and >> on the command line, followed by a device or file name. The standard output of one command can also be sent to the standard input of the next command by including the piping symbol | on the command line between the two commands. See section 1.5 on Redirection and Piping for more details of these facilities.
When a transient command is executed, that command may overwrite some of the memory that COMMAND2.COM was using. Thus when the command terminates, COMMAND2.COM may need to re-load itself from disk into memory from the COMMAND2.COM file that it was originally loaded from. This file is located by looking at the SHELL environment item (see section 1.7 on Environment Items), or the root directory of the boot drive if it is not found there. If it is still not found, then a prompt is issued. For example, if MSX-DOS was booted from drive A:, then the prompt will be:
Although not a command as such, the currently logged on drive can be changed by giving the command:
In the command examples that follow, underlined text is an example response to a command, and the other text consists of the example command given by the user. In most examples a single space is shown as the parameter separator, although other separator characters can be used as specified above.
Sets up the logical to physical translation of drives.
If no drives are given, then all current drive assignments are cancelled.
If only one drive is given, then the physical drive to which this
refers is printed.
If both drives are given, then the subsequent access to the first
drive (logical drive) will be done to the second drive (physical drive)
by MSX-DOS.
Changes the attributes of directories to make them hidden/not hidden.
The compound-filespec specifies the directories whose attributes are
to be changed.
If +H is given, then the selected directories are marked
as hidden, and will not be affected by other directory commands or
shown by a DIR command unless a /H option is given
with those commands. The -H option marks the selected directories
as not hidden, and will not have any effect unless the /H
option is given.
Unlike files, directories cannot be made read only.
When an error occurs, the erroneous directory name is printed followed
by an error message, and the command will continue with the next directory.
If many errors occur, then the /P option can be used to cause
the output to pause at the end of the screen.
The DIR /H command can be used to indicate the current attributes
of directories.
Changes the attributes of files to make them hidden/not hidden and read only/not read only.
The compound-filespec specifies the files whose attributes are to be changed, and /H allows hidden files to also have their attributes changed.
If +H is given, then the selected files are marked as hidden, and will not be affected by most commands or be shown by the DIR command unless a /H option is given with those commands. -H marks the selected files as not hidden, and will not have any effect unless the files are hidden.
If +R is given, then the selected files are marked as read only. -R marks the selected files as not read only (read/write). Read only f iles cannot be written to or changed.
When an error occurs, the erroneous filename is printed followed by an error message, and the command will continue with the next file. If many errors occur, then the /P option can be used to cause the output to pause at the end of the screen.
The DIR command can be used to indicate the current attributes of files.
Transfers control to MSX disk BASIC.
[program] is the name of a BASIC program on disk.
Control is passed to the built-in MSX BASIC, which will load and execute the BASIC program if specified. If a RAM disk has been set up, then it can still be used from BASIC.
The BASIC command CALL SYSTEM("command") can be used to return to MSX-DOS, and the optional command, which can be any command executable on MSX-DOS, will be executed. If the command is not given, then a batch file called REBOOT.BAT will be searched for and executed if found (see section 1.6 on Batch Files).
Displays or changes the number of disk buffers in the system.
If the number is not given, then the number of disk buffers currently in the system will be displayed, otherwise the number of buffers will be changed to the specified number, the now unused memory being freed for other purposes if the new number is less than the previous. If there is not enough memory for the specified number of buffers, then as many as possible are created and no error is given.
Increasing the number of disk buffers may speed up some applications, particularly those that perform random accesses to files. Setting the number above 10 is unlikely to improve performance much, and unnecessarily uses up memory.
The memory area used for disk buffers is also used for environment items and for opening files. Thus keeping buffers set to the maximum possible may prevent some commands from working, particularly SET, COPY and CONCAT. If any of these commands give a 'not enough memory' error then it may help to reduce the number of buffers. Reducing them below about three however will impair performance considerably.
The default number of buffers in the system is 5, which will be adequate for most purposes.
BUFFERS=5
A>
or
CD [d:] [path]
Displays or changes the current directory.
If no path is specified, then the current directory path for the current or specified drive is printed. This is the directory path from the root directory to the current directory.
If a path is specified, then the current directory for the current or specified drive is changed to the directory specified by the path.
Each drive has it's own current directory. This remains at the directory specified by the last CHDIR command for that drive (or at the root directory initially) until another CHDIR command 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.
The CD command is an abbreviated form of the CHDIR command provided for convenience and MS-DOS compatibility.
Note that the command prompt can be changed to display the current directory with the command SET PROMPT ON (see section 1.7 on Environment Items).
E:\DIR1
A:\DIR2
Checks the integrity of the files on the disk.
The integrity of the data structures on disk in the specified or current drive is checked and lost disk space is checked for. When errors are found on the disk, corrective action is taken. If lost clusters are found, a prompt is issued allowing the lost disk space to be either converted into usable disk space or into files. If the latter is chosen, then files of the form FILE0000.CHK, FILE0001.CHK etc. will be created.
If the /F option is not given, then CHKDSK will not actually write any corrections it makes to disk, but will behave as though it has. This allows CHKDSK to be executed to see what would be done to the disk if /F was given.
Disk space can become lost (ie. lost clusters created) when some programs are aborted. This applies particularly to CP/M programs. It is recommended that CHKDSK is used occasionally on all disks.
Note that this is a transient command, and must therefore be loaded off disk.
20 lost clusters found in 1 chain
Convert lost chains to files (Y/N) ?
Clears the screen.
Simply clears the screen and homes the cursor.
Invokes the command interpreter.
command is any command that can normally be typed at the prompt (such as the commands in this manual).
COMMAND2 is simply the name of the command interpreter on disk, and can be executed as a normal transient program. In normal use it gets loaded and executed once by MSXDOS2.SYS at the boot time, and this provides the ability to perform all the commands in this manual.
Advanced users may, however, wish to invoke another command interpreter for a variety of reasons. The second COMMAND2.COM may, for example, be a later version and provide more facilities. If a transient program has the ability to load and execute programs, as some sophisticated programs do, then they can load the COMMAND2.COM program and any MSX-DOS command can then be given. When COMMAND2.COM exits by EXIT command, the original program will be returned to.
If no command is given as a parameter, then the second COMMAND2.COM
will simply issue the normal prompt (without executing AUTOEXEC.BAT
or REBOOT.BAT) and wait for commands in the normal way. It
will terminate and exit back to the original command interpreter or
program when the EXIT command is given (see the EXIT
command on page
). If an error code is given to
this EXIT command, then the original command interpreter
or program will receive it and, in the case of COMMAND2.COM
and MSXDOS2.SYS, print an appropriate error message (see
section 1.8 on Errors).
If a command is given as a parameter to COMMAND2.COM however, then it will be executed as though it had been typed in the normal way. The command may be an internal command or an external COM or BAT command. After executing the command, COMMAND2.COM will immediately exit back to the original command interpreter or program.
In this way, invoking a second COMMAND2.COM from the normal command interpreter with a batch file name as a command can be used to 'nest' batch files (see section 1.6 on Batch Files), instead of 'chaining'.
When COMMAND2.COM is executed, it saves the whole environment, and then restores it again when it exits. It only sets up the default environment items however if they are not already defined. Thus the second COMMAND2.COM inherits the environment of the first. Any changes made whilst the second COMMAND2.COM is executing will only last as long it does, and will be lost when it exits.
Each incarnation of COMMAND2.COM uses up some memory which is freed again when it exits. This depends partly on the number of environment items, and is typically about 1.5K.
When COMMAND2.COM executes a transient program, it may have to re-load itself off disk since the program is allowed to use the memory occupied by COMMAND2.COM. In this case, it uses the SHELL environment item to locate the file that it must use to load itself (see section 1.7 on Environment Items). When first loaded from the COMMAND2.COM file on disk, SHELL is set to refer to that file.
A>
Concatenates (joins together) files.
The compound-filespec specifies the files that are to be joined together, and /H allows hidden files to be joined.
The second parameter is a filespec that must be unambiguous and is created before the source files are read. Each source file is then read, joined onto the end of the previous one and written out to the destination.
As each source file is read, its filename is printed. If for some reason the file cannot be read (eg. it is the file that has been created as the destination) then the filename is followed by an error message and the CONCAT operation continues with the next source file. If many files are being concatenated, then /P will cause the output to pause at the end of the screen until a key is pressed.
Normally, the concatenation is performed on ASCII files. Source files are read up to the first end-of-file character (CTRL-Z) and a single end-of-file character is appended to the destination after all data has been written out. If, however, /B (binary mode) is given, then no interpretation is given to the data read and no additional data is added.
It is also possible to give the /B to the destination or to any of the filespecs in the compound-filespec, and it will then refer only to those files. /A may also be given to reverse the effect of /B.
The /V option can be given to turn write verification on for the duration of the CONCAT command (see the VERIFY command). This will ensure that data is written correctly to disks if the device driver being used has the feature, but will slow the operation down for the verification.
If CONCAT gives a 'Not enough memory' error then probably reducing the number of buffers (see the BUFFERS command) or removing some environment items (see section 1.7 on Environment Items) will free up sufficient memory.
FILE1.DOC
FILE2.DOC
FILE3.DOC
ALL.DOC - Destination file cannot be concatenated
Copies data from files or devices to other files or devices.
The definition of the source is:
The definition of the dest is:
COPY will read as many source files as possible into memory before writing any out. When it can read no more into memory (eg. when it has used all available memory) it will write out each file in the order that it read them. When it creates each destination file, it prints the source filename. Then if it is unable to create the destination file, an error message is printed and the copy operation continues with the next file. /P can be given to make the output pause at the end of the screen.
Many reasons exist for COPY to be unable to create the destination, such as a read-only file already existing with the same name. Sometimes COPY will refuse to create the destination because the user may have made a mistake. For example, a file cannot be copied onto itself, or several files cannot be copied onto one file. A 'Cannot create destination' error may be given if the destination of one file would delete a previous source file or a file already being used for something else (eg. the currently executing batch file). A 'Cannot overwrite previous destination file' error results if an attempt is made to copy many files to one file. This usually means that the intended destination was a directory, but that the name has been misspelled.
If /A is specified, then an ASCII copy is performed. This means that source files will only be read as far as the first end-of-file (EOF) character (CTRL-Z) and then each destination will have a single end-of-file character appended to it.
It is also possible to give a /A to the destination or to any of the filespecs in the compound-filespec separately, in which case it applies only to that source or dest specification.
The /B option can be given to copy in binary mode, that is, the file being read will be copied as it is and no data will be added.
The /V option can be given to turn write verification on for the duration of the COPY command (see the VERIFY command). This will ensure that data is written correctly to disks if the device driver being used has the feature, but will slow the operation down.
Normally, the destination files are given the same date and time as the source files. However, the /T option can be given to cause the destination files to have the current date and time. The destination files will not be hidden or read-only, regardless of the attributes of the source files. The ATTRIB command can be used to change these.
If COPY gives a 'Not enough memory' error then probably reducing the number of buffers (see the BUFFERS command) or removing some environment items (see section 1.7 on Environment Items) will free up sufficient work area.
Note that the COPY command is simpler than that in MS-DOS and MSX-DOS 1 because it cannot concatenate (join together) files. To do this, a CONCAT command is available (see the CONCAT command).
AUTOEXEC.BAT - File cannot be copied onto itself
REBOOT.BAT - File cannot be copied onto itself
AUTOEXEC.BAT
REBOOT.BAT - Cannot overwrite previous destination file
Displays or sets the current date.
If the date is given after the command, then the date is set to this value (for the format see below). If the date is not given after the command, then the current day and date is printed and the new date is prompted for and input. If no input is given (ie. if the 'ENTER' key alone is pressed) then the current date is not altered. Otherwise the input is assumed to be a new date, and is interpreted as described below. If the date is invalid then an error message is displayed and the new date again prompted for and input.
The date is expected to consist of up to three numbers, separated by one of the following characters:
The format in which the date is printed and input is flexible and can be changed. An environment item called DATE is set up by default to a format that is appropriate for the country of origin of the MSX machine (see section 1.7 on Environment Items). For example, on Japanese machines the default setting is YY-MM-DD. The command SET DATE DD-MM-YY will change the date format to the European format. The format also affects the dates printed by the DIR command.
If the DATE environment item is defined, then it will be printed by the DATE command to indicate the format in which the date is required to be input.
Current date is Wed 1986-06-18
Enter new date (yy-mm-dd): - -19
Current date is Thu 19-06-1986
Enter new date (DD/MM/YY):
A>
Formats are:
Displays the names of files on disk.
The compound-filespec specifies which files are to be listed. If the /H option is given, then hidden files will also be listed.
In the DIR command, unlike all other commands, it is permissible to not give the main filename or the filename extension, and both will default to '*'. Thus a filename of 'FRED' is equivalent to 'FRED.*' and a filename of '.COM' is equivalent to '*.COM'. Note that if the '.' at the end of a main filename is given, then the extension is also assumed to have been given, so that the filename 'FRED.' is not equivalent to 'FRED.*', unlike the example above.
There are two formats of the listing. If the /W option is given, then a wide listing is printed, with several filenames output per line. Sub-directory names, file attributes, and the date and time each file was created are not displayed.
If the /W option is not given, then the filenames are printed with one filename per line, together with the attributes, the file size and the date and time at which the file was last modified. The attributes are printed as an 'r' if the file is read-only and an 'h' if the file is hidden (and /H is given). If the time of a file is zero (ie. the file does not have an associated time) then the time field will not be printed. If the date of a file is zero, then neither the date nor the time fields will be printed. The formats in which the dates and times are printed can be changed (see the DATE and TIME commands).
The non-/W display is designed to fit within a 40 column screen, but if fewer columns are available then some fields of the listing will not be shown so that the display will always fit on one line. The number of files per line that are printed when /W is specified is also adjusted according to the screen width. If the width of the display is less than 13 characters however, then in both cases the filenames will wrap to the next line.
At the top of the list of files, the volume name of the disk and the name of the directory being listed is displayed. At the bottom, the number of files listed, the total number of bytes in the files and the amount of remaining disk space is printed.
When the directory of a sub-directory is printed, the first two items listed will always be two special sub-directories called '.' and '..'. These are automatically created when a new directory is created, and it is these that allow '.' and '..' to be given in path names to signify the current and parent directories respectively (see section 1.3 on Notation for a description of paths).
When printing a number of bytes, the number is truncated and printed as the number of kilobytes if 1K or greater.
If the /P option is given, then the output will pause at the bottom of the screen until a key is pressed.
Directory of A:\
MSXDOS2 SYS r 4096 86-06-19 2:45p
COMMAND2 COM r 10496 86-06-19 2:46p
UTILS <dir> 86-06-19 2:50p
HELP <dir> 86-06-19 2:50p
14K in 2 files 222K free
Directory of B:\HELP
BUFFERS .HLP ATTRIB .HLP ASSIGN .HLP
ATDIR .HLP CHDIR .HLP CD .HLP
SYNTAX .HLP ENV .HLP BATCH .HLP
EDITING .HLP
25K in 10 files 222K free
DIR UTILS + HELP /P
Copies one disk to another.
The first drive is the source drive and the second the destination, which defaults to the current drive. If no drives are given, then DISKCOPY will prompt for both the source and the destination.
Before DISKCOPY is used, the destination disk must be formatted with the same format as the source disk, and an error will be given if this is not the case.
If /X is given, then various messages printed during the disk copy operation will be suppressed.
Note that this is a transient command, and must therefore be loaded from disk.
Insert source disk in drive A:
Insert target disk in drive B:
Press any key to continue...
Enter source drive:
Enter target drive:
Prints text.
The text is simply displayed on the screen. If no text is given, then just a blank line is output.
This command should not be confused with the echo state in batch files, which is controlled by an environment item called ECHO (see section 1.7 on Environment Items).
AUTOEXEC batch file executed
Deletes one or more files.
The compound-filespec specifies which files are to be deleted. The /H option allows hidden files to also be deleted.
During the delete operation, if a file cannot be deleted for some reason (eg. it is set to 'read only') then the offending filename is printed along with an error message, and the delete operation continues with the next file. If many such errors occur, then the /P option will cause the output to pause at the end of the screen.
If the filename is *.*, then the prompt:
If files are deleted unintentionally on a disk that was formatted under MSX-DOS 2, then the UNDEL command may be used immediately afterwards to restore them again.
Erase all files (Y/N) ?
AUTOEXEC.BAT - Read only file
REBOOT.BAT - Read only file
Exits COMMAND2.COM to the invoking program.
The number is an error code and defaults to 0, which in MSX-DOS indicates no error (see section 1.8 on Errors).
EXIT exits the command interpreter (COMMAND2.COM) and returns the error code to the program that originally loaded and executed it (see the COMMAND2 command). This may be another COMMAND2.COM, another program or, normally, MSXDOS2.SYS. In the latter case, an appropriate error message will be printed and COMMAND2.COM simply reloaded and executed.
COMMAND2.COM when loaded saves the current environment (see section 1.7 on Environment Items), and EXIT restores it. Thus, when EXIT exits back to MSXDOS2.SYS (that is, EXIT is executed at the primary level), the environment will be cleared. COMMAND2.COM will then be reloaded and will set up the default environment again, providing a method of resetting the environment to its default values.
*** User error 40
Updates a disk to the full MSX-DOS 2 format.
d: specifies the drive on which FIXDISK is to operate. If d: is not specified, the current drive will be assumed. /S option causes the disk to be updated to full MSX-DOS 2 disk.
This command is mainly used to update MSX-DOS 1 disks to full MSX-DOS 2 compatibility, but may also be useful for updating other disks of a similar format or reparing incorrect boot sector.
Although the disk format used by MSX-DOS 1 and MSX-DOS 2 is standardized, MSX-DOS 1 does not use the information stored on certain parts of the disk (the boot sector) and so this information is not necessarily correct on MSX-DOS 1 disks. This can cause problems when MSX-DOS 2 is used with these disks. Additionally, the MSX-DOS 2 UNDEL command will only work with disks that were formatted using MSX-DOS 2 (ie. disks that have a 'volume id' in the boot sector) and so will not work with MSX-DOS 1 disks or disks formatted on other systems.
The FIXDISK command will update a disk so that it is fully MSX-DOS 2 compatible, and its use will allow full use of MSX-DOS 2 disk features. If /S option is specified, the boot program will be updated for MSX-DOS 2 so that the features of MSX-DOS 2 disk can fully work. When a disk has been updated in this way, however, it may no longer be fully compatible with the original system. For example, if /S option is specified against the disk of the application which uses non-standard boot program, such as some games, the application will no longer be booted, although it will still be able to start MSX-DOS 1 or MSX-DOS 2.
To help prevent accidental updates of boot disks from other systems, a prompt is issued before updating a disk.
Disk in drive B: will only be able to boot MSX-DOS 2
Press any key to continue...
Formats (initializes) a disk.
The specified or current drive is formatted, and all data on the disk will be destroyed.
After giving a FORMAT command, an option may be prompted for, allowing the required format of the disk (such as 1DD or 2DD) to be selected. The exact nature of these prompts depends on the manufacturer of the MSX machine, so obey the descriptions of the manual of the machine when you want to format the disk.
After formatting, there will be no files or directories on the disk, and the maximum amount of disk space will be free. The disk will not have a volume name, but can be given one with the VOL command. To turn the disk into a boot disk so that MSX-DOS can be started up from it, the files MSXDOS2.SYS and COMMAND2.COM must be copied onto it with the COPY command.
1 - Single sided
2 - Double sided
? 2
All data on drive B: will be destroyed
Press any key to continue...
Provides on-line help for an MSX-DOS feature.
If no parameter is given, then a list of standard subjects on which help is available is printed. This includes all the commands and the major system features.
If a subject is specified, then help text on this subject is printed on the screen from a 'help file'. This will pause at the end of every screen until a key is pressed.
Help files have a filename of:
An environment item called HELP is set up initially to refer to the HELP directory (see section 1.7 on Environment Items). This can be changed with the SET command to refer to any other directory or disk if required.
Any HELP subject can be added by the user for his own use simply by adding the appropriate .HLP file in the HELP directory. The help file will be displayed very much like the TYPE command would display it.
*** File for HELP not found
Creates a new sub-directory.
The last item in the path is the name of the new sub-directory which is to be created on the current or specified drive. Thus if this is the only item in the path, the new directory is created in the current directory. If the new directory is to be hidden, then it must be separately made hidden with the ATDIR command.
When a new directory is created, it is empty except for two special sub-directories called '.' and '..'. These are automatically created in the directory and it is these that allow '.' and '..' to be given in path names to signify the current and parent directories respectively (see section 1.3 on Notation for a description of paths).
The MD command is an abbreviated form of the MKDIR command provided for convenience and MS-DOS compatibility.
Changes the number of characters/line on the screen.
The number must be in the range 1 to 80 inclusive, and the number of characters per line on the screen will be set to this. The screen will be cleared and the cursor moved to the top left corner in the process.
Moves files from one place to another on a disk.
The compound-filespec specifies which files are to be moved, and /H allows hidden files to be included in the move.
The path specifies the directory to which the files are to be moved, the current directory being used if this is not given. The path must exist on each drive referenced by the filespecs in the compound-filespec.
If a particular file cannot be moved into the specified or current directory (eg. if a file of the same name already exists) then the offending filename is printed along with an error message, and the move operation continues with the next file. If many errors occur, then the /P option will cause the output to pause at the bottom of the screen.
COMMAND2.COM - File exists
Moves directories from one place to another on a disk.
The compound-filespec specifies which directories are to be moved, and /H allows hidden directories to be included in the move.
The second parameter specifies the directory into which the directories are to be moved, the current directory being used if this is not given. The path must exist on each drive referenced by the filespecs in the compound-filepecs.
If a particular directory cannot be moved into the specified or current directory (eg. if a directory of the same name already exists) then the offending directory name is printed along with an error message, and the move operation continues with the next directory. If many errors occur, then the /P option will cause the output to pause at the bottom of the screen.
Note that it is not possible to move a directory into one of its own descendant directories, as this would produce an invalid sub-directory tree. An error is given if this is attempted.
DIR2 - Duplicate filename
Displays or sets the COM and BAT command search path
If no parameters are specified, then the search path currently set will be displayed, separated by semi-colons (';').
If + or - is not given, then the search path will be set to the list of path names given and any existing search path will be deleted.
If - is given before the list of paths, then each path in the list will be deleted from the currently set search path, and an error will be given if any of the given paths do not already exist.
If + is given before the list of paths, then each path specified will first be deleted from the currently set search path if it exists, and will then be added onto the end. This allows the order of the paths in the search path to be changed and allows new paths to be appended to the end of the current search path. The + syntax can also be used to set a search path longer than can be given in one command, the maximum length of the search path being 255 characters and the maximum length of a command 127 characters.
When searching for a COM or BAT file, the paths in the current search path will be used in order from left to right. It is recommended that the paths in the search path are specified as full paths starting at the root directory and with the drive specified. If this is not the case, then the meaning of the search path could change when the current drive or directory is changed.
The search path is stored as an environment item (see section 1.7 on Environment Items), and so can also be accessed with the SET command.
; E:\COM; E:\BAT
; E:\COM; E:\BAT; A:\COM; A:\BAT
; A:\COM; A:\BAT
Prompts and waits for a key press in a batch file.
The comment consists of an arbitrary sequence of characters.
The comment, if given, is printed followed by the prompt 'Press any key to continue... ' on the next line. The system will then wait for a key to be pressed and will echo the key pressed if it is a printable character. If no comment is given as a parameter, then just the prompt will be printed.
The main use of this command is to issue prompts from within a batch file.
Press any key to continue...
Insert document disk in drive B:
Press any key to continue...
Displays or sets the RAM disk size.
If no parameters are given, then the current RAMDISK size is displayed as the number of kilobytes.
The number, if given, specifies the maximum size for the new RAM disk, and is specified in kilobytes. The range is 0 to 4064. If the number is 0 or only /D is specified, the RAM disk will be deleted. This number will be rounded up to the nearest multiple of 16K since the RAM disk is always a multiple of 16K. A RAM disk smaller then the specified maximum size may be created if there is not enough free memory for the full size, although a 'not enough memory' error will be given if there is no memory at all available for the RAM disk. Note that the number specified is the maximum amount of RAM to use for the RAM disk, which is not the same as the maximum amount of free space available on the newly-created RAM disk since the system needs to use some for FAT or directories.
On MSX machines with 128K RAM, the maximum amount of RAM disk is 32K.
If a RAM disk already exists before a new one is created, then a 'Destroy all data on RAM disk (Y/N)?' prompt is printed to avoid accidental loss of data. /D can be given which will automatically delete any existing RAM disk first, thus suppressing the prompt.
Having created a RAM disk, it can be referred to as drive H:.
The RAMDISK command is normally only used in an AUTOEXEC.BAT batch file, with a large number specified so that as large a RAMDISK as possible is created. It is not advisable to keep any data on a RAM disk except for a short length of time that is not also kept on a floppy disk, since it will be lost if, for example, the power to the computer fails.
RAMDISK=160K
*** RAM disk does not exist
Destroy all data on RAM disk (Y/N)? y
Introduces a comment in a batch file.
The comment is simply ignored, and the next command executed. The comment consists of a sequence of any characters up to the maximum length of a command line (127 characters).
Renames one or more files.
The compound-filespec specifies the files that are to be renamed, and /H allows hidden files to be included in the rename operation.
The second filename specifies the new name for the files. A '?' in the new name indicates that the corresponding character from the filename being renamed will be used, thus allowing an ambiguous rename. Thus '*' in the second filename, which is just equivalent to a series of '?'s, indicates that the whole of the filename or extension will remain unchanged.
If for some reason a particular file cannot be renamed (eg. if a file or directory with the new name already exists or they are read-only) then the offending filename will be printed along with an error message and the rename operation will continue with the next file. If many errors occur, then /P will cause the output to pause at the end of the screen.
FILE2.DOC - Duplicate filename
Removes one or more sub-directories.
The compound-filespec specifies which directories are to be deleted, and /H allows hidden directories to be included in the delete operation.
In order to delete a directory, it must contain no other files or other directories except for the special '.' and '..' directories which are always contained in a directory. These are put in a new directory when it is created and cannot be removed. It is these that allow '.' and '..' to be used in path names to specify the current and parent directories respectively (see section 1.3 on Notation for a description of paths).
If a directory cannot be deleted for some reason (eg. it is not empty) then the name of the offending directory is printed along with an error message, and the delete operation continues with the next directory. If many errors occur then /P will cause the output to pause at the end of the screen.
UTIL - Directory not empty
Renames one or more sub-directories.
The compound-filespec specifies the directories that are to be renamed, and /H allows hidden directories to be included in the rename operation. The contents of the directories remain unchanged.
The second filename specifies the new name for the directories. A '?' in the new name indicates that the corresponding character from the name of the directory being renamed will be used, thus allowing an ambiguous rename. Thus '*' in the second filename, which is just equivalent to a series of '?'s, indicates that the whole of the filename or extension of the directory name will remain unchanged.
If for some reason a particular directory cannot be renamed (eg. if a file or directory of the new name already exists) then the offending directory name will be printed along with an error message and the rename operation will continue with the next directory. If many errors occur, then /P will cause the output to pause at the end of the screen.
UTIL - Duplicate filename
Displays/sets environment items.
If no parameters are given, then all currently defined environment items and their current values are displayed. Initially there are several items set up to default values (see section 1.7 on Environment Items).
If just a name is given as the parameter, then the current value of the specified environment item is printed.
If the name is followed by a separator, then the separator is ignored and the name is set to the following value. If the value is blank (ie. not given) then the environment item is deleted from the environment space.
The area of memory used for environment items is also used for disk buffers. Thus if a 'not enough memory' error occurs when using the SET command, then it may help to reduce the number of disk buffers (see the BUFFERS command).
Section 1.7 contains more information about environment items and the items and values that are set up by default.
ECHO=OFF
PROMPT=OFF
PATH=;
TIME=12
DATE=yy-mm-dd
HELP=A:\HELP
SHELL=A:\COMMAND2.COM
A:\HELP
Displays or sets the current time.
If the time is given after the command, then the time is set to this value (for the format see below). If the time is not given after the command, then the current time is printed and the new time is prompted for and input. If no input is given (ie. if the 'enter' key alone is pressed) then the current time is not altered. Otherwise the input is assumed to be a new time, and is interpreted as described below. If the time is invalid then an error message is displayed and the new time again prompted for and input.
The time is expected to consist of up to four numbers, separated by one of the following characters:
The format in which the time is printed is flexible and can be changed. An environment item (see section 1.7 on Environment Items) called TIME is set up by default to the value '12', which indicates that the time will be printed in 12 hour format with a following 'a' or 'p' for am and pm. The command SET TIME 24 will cause the time to be printed in 24 hour mode. The time can be input unambiguously in either format. The time format also affects the times printed by the DIR command.
Current time is 10:45:00a
Enter new time:
Displays data from a file or device.
The compound-filespec specifies the files that are to be displayed, and /H allows hidden files to be typed. If the compound-filespec is ambiguous, then the filename is printed before each one is typed.
If /B is specified, then data is read from each file and displayed without modification on the screen, until the end of file is reached. This may have strange effect on the screen if the file contains control characters.
If /B is not given, then TYPE will look for the end-of-file character (CTRL-Z) and stop when it finds it. Also control characters except carriage return, line feed and tab will be converted into characters that can be printed, A for ^A, W for ^W, etc.
If /P is given, then the output will pause at the end of the screen until a key is pressed.
Recovers a previously deleted file.
The filespec specifies which files are to be undeleted if possible, and defaults to *.*.
Files can only be undeleted if they have been deleted using MSX-DOS 2 on an MSX-DOS 2 formatted disk and if no disk allocation has taken place since the file was originally deleted, which usually means that they have to be undeleted immediately after they have been deleted.
Each deleted file and directory reference that is found in the directory specified by the filespec will be undeleted if its name is matched by the filename in the filespec, and if undeletion is possible. UNDEL can therefore be used to restore a directory removed with the RD or RMDIR commands; to restore the contents of the directory a further UNDEL command is required specifying the now undeleted directory.
Note that UNDEL is a transient command, and therefore must be loaded from disk.
Displays the system's version numbers.
The version numbers of the three main components of the MSX-DOS disk system are displayed. Each version number consists of three digits. The first digit is the main MSX-DOS version number and for MSX-DOS 2 will always be 2. The second digit is the version number and will change for future versions that have, for example, had extra major features added. The last digit is the release number and will change with different releases of the same version of the system which have had minor changes, improvements and corrections made.
MSX-DOS kernel version 2.20
MSXDOS2.SYS version 2.20
COMMAND2.COM version 2.20
Copyright 1988 ASCII Corporation
Displays/sets the current disk write verify state.
If no parameters are given, then the current verify state is displayed on the screen.
If ON or OFF is given, then the verify state is changed appropriately.
The verify state affects all writes to disk. If OFF, the default state, then data is simply written. If ON, then after writing the data it is read back and compared with the original to ensure that it was written correctly. The extra overhead of this means that writing is slower when verify is on.
This feature depends on the device driver, so this will have no effect if the driver does not have the feature.
VERIFY=OFF
Displays or changes the volume name on a disk.
If no parameters are given, or if only a drive name is given, then the volume name of the current or specified drive is printed.
If a volname is given, then the volume name of the specified or current drive is changed to the specified volume name.
Volume in drive B: has no name
Copies files and directories from one disk to another.
The options available are:
/T (time) will cause the copied files to have the current date and time rather than the source file's date and time.
If /A (archive) is specified, then only files with the 'archive' attribute set are copied. A file has an archive attribute in the same way as a 'hidden' attribute and a 'read only' attribute. It is set whenever a file is updated (written to).
/M is similar to /A, but resets the archive bit after copying the file. Thus, using this option, files can be regularly copied onto another disk only if they have been updated, providing a file backup facility.
/S causes XCOPY to copy directories as well as files. Within each directory, all files are copied and then any matching files within each directory are copied, with the directory being created on the destination if it does not already exist. Normally, these directories will not be created if no files are to be copied into them.
/E can be given to cause the /S option to create all directories, even if they are empty.
The /P (pause) option will cause XCOPY to pause and prompt before copying each file, which allows files to be selectively copied.
/W (wait) causes XCOPY to pause and prompt before copying any files, so that disks can be changed.
/V option can be given to turn write verification on for the duration of the XCOPY command (see the VERIFY command). This will ensure that data is written correctly to disks if the device driver being used has the feature, but will slow the operation down.
Note that XCOPY is a transient command, and so must be loaded off disk.
Lists all files within directories.
The filespec specifies which files are to be listed, and /H allows hidden files to be included.
XDIR is similar to the DIR command, but does not print the files' dates and times.
After all files in the specified directory have been listed, then files within descendant directories are also listed, and are shown indented. This allows a DIR of a complete directory tree or disk to be obtained.
Note that XDIR is a transient co