" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#008000" VLINK="004000" ALINK="#00C000">
INTERNAL DOS COMMAND ARGUMENTS
PTS-DOS operating system commands are divided in two groups:
- resident, or internal commands,
- transient, or external commands.
Internal commands are a part of the operating system and are loaded
together with it. Running internal commands doesn't require the presence of
a system disk in a drive.
External commands are files, recorded on a system disk. As the
procedures of these commands are not included in the standard DOS shell, the
COMMAND.COM program, they should be loaded before running. This means that
the diskette containing the external commands should be inserted into the
drive. There is no need to specify the type of an operating system command
when invoking it.
The terms LIST, FILELIST, DIRLIST are used in many internal DOS
commands as arguments. Semantically the term LIST may be described as
follows:
LIST::=[ctrl_params]
{
character_string|
(LIST[,|+| ]...)|
@reference_file
}
Attention! Character "+" in source part of COPY command means merging
of several files into one file.
The semantic notation will be described below line by line.
Conrtol parameters
Control parameters of the list define the way of processing its
elements. Control parameters do not change the order of processing. They
are always put before the list elements which they influence, and they
influence ALL the elements located in string after them.
The control parameters for FILELIST or DIRLIST may be only the
following:
/S - to include all subdirectories of the given directory in the
search by pattern;
/O[:order] - sets the directory element sorting criteria, where
"order" is a set of the sorting criteria control symbols:
G - sort on the attributes
N - sort on the file names
E - sort on the file extensions
S - sort on the file size
D - sort on the date of creation
Minus sign before a control symbol changes the sorting
criteria to a complementary one. If no order parameter is
present, the following sorting criteria is used: on
attributes, then on names and extensions.
/A[:attrs] - sets the attribute mask to search, where "attrs" may
be the following:
R - sets the "read-only" attribute
S - sets the "system" attribute
H - sets the "hidden" attribute
A - sets the "archive" attribute
Minus sign before a control symbol means searching for files
without the specified attribute. If there are no "attrs"
after the /A switch, the files with arbitrary attributes will
be searched for.
Character string
Character_string cannot contain any delimiter characters (space, tab,
comma, semicolon, plus sign) or a restrictor characters (opening and closing
parentheses, quotes, double quotes) and a special symbol "@" as first one.
The examples of character strings:
ABC
abcdef - right strings
12ab
AB C,C
AB(C) - wrong strings
A"BC"
@123
(LIST[,|+| ]...)
Any LIST element can represent a complex structure itself and may
contain character strings, parentheses, and reference file specifications.
One should be extremely careful when writing LIST, and be sure that every
opening parentheses corresponds to the closing one.
The examples of complex arguments:
(AAA,BBB,CCC) - a list of character strings as elements;
((a:\1,a:\2),b:\) - a list, containing sublist as the first element
(a:\1,a:\2) and character string b:\ as the second
one.
((/s c:,d:),(mail.txt, reply.txt)) - a list, containing two sublists
as arguments.
Control parameters before command arguments influence all the following
list of elements (character strings and contents of reference files), with
no regard to the recursive level of the element. For some internal commands
(COPY, REN, etc.) the thing of great importance is the first recursive level
(so-called bundles, that compose the so-called basket). Basket here is a set
of bundles, following one another and enclosed between the first opening and
the last closing parentheses. So, in the examples above the bundles are:
for the first example - (a:\1, a:\2) and b:\
for the second example - (/s c:,d:) and (mail.txt, reply.txt)
The bundles may be either lists or character strings. You may use the
basket, say, in COPY command.
COPY ((*.c,*.h),(*.asm,*.inc)) (a:\,b:\)
When executing this command all files from the first bundle (*.c,*.h)
of source willbe copied to the corresponding bundle of the target basket (to
the root of the A: disk). Similarly all the files of the secong bundle will
be copied to the root of the B: disk.
Complex bundles may occur in the target basket. The following command
copies files with extension .ASM to the disks A and B simultaneously:
COPY *.ASM ((A:,B:))
Note, that the command
COPY *.ASM (A:,B:)
copies files with ASM extension only to the A:, second bundle B: will be
ignored (See the COPY command).
@reference_file
Parameter "reference_file" after special symbol "@" defines the name of
a text file that will be used for reading list elements from. So, the
reference file contains elements to be used in the command.
In one of the examples above we could substitute the target bundle for
the reference file:
COPY ((*.c,*.h),(*.asm,*.inc)) @responce.txt
where the contents of responce.txt is:
a:\
b:\
The difference between LIST and FILELIST(DIRLIST)
The main difference between LIST and FILELIST(DIRLIST) is in the
treatment of the "character string" notion. In FILELIST(DIRLIST) only the
filenames(dirnames) may be used in a character string. Sure, these names may
contain only the symbols allowed by DOS for filenames (dirnames).
In a FILELIST (DIRLIST) one may specify a group of files(directories)
in one "character string" using wildcard symbols "*" and "?" But the use of
these symbols is allowed only in the last element of the composite filename
(directory name) after the last backslash.
Asterisk (*) in the name (extension) of the file(directory) means an
arbitrary amount of any (but allowed by DOS for names) characters. All
other characters following the asterisk will be ignored. So, all the
files(directories) that match the pattern, will be used in the command.
Character "?" in the name (extension) of the file (directory) means
that it can be replaced by any allowed symbol, but only once. In this case
any characters, following the "?" symbol, preserve their meanings.
Examples:
*.* or ????????.??? - means all the files in the current directory.
*a.asm or ????????.asm - means all the files having the .ASM extension.
FILE?.txt - means all files having the .txt extension, whose
names contain five characters and first four of
them are "FILE".
If FILELIST contains a name of existing directory, then "\*.*" is
implied after this name (all files in this directory are implied).