A Review of DOS
Characters and Symbols
When using DOS, a number of characters and symbols will
be encountered. These are appointed for various operations,
such as short names, wildcards, designators, and for many other
purposes. Over 40 of them will be discussed in the following article.
Not all aspects or functions will be addressed. Some are purposed by DOS
in additional ways, but for the most part, these ways, along with characters
not shown, are behind the scenes or are seldom employed by most DOS users. As
such, they will not be considered.
Understand that not everything may apply to your manufacturer
or version of DOS. In particular, many symbols discussed
below were not employed as described until 1990s
versions of DOS. Conversely, some purposes
have fallen into disuse in newer DOSes.
Symbol names will be capitalised
for the purpose of this article.
NOTHING IN THIS ARTICLE MAY BE REPRODUCED
WITHOUT PERMISSION FROM THE AUTHOR ©
The CHARACTERS and SYMBOLS
- [ & ] (Ampersand) (AM-perr-sand) Used by 4DOS to indicate
that both standard out and standard error are to be directed
to a file or device. It also is used to denote command-line
parameters in batch files.
- [ && ] (Double Ampersand) Used by 4DOS as a special type
of command separator. It is used between two commands where one
wants the command following `&&' to be executed only if the
first command is successful. This will work only with a command used
before `&&' that returns an exit code of `0' (zero). If exit
codes are employed, `zero' is the one generated by most DOS commands
when operations are completed with no (zero) errors. That is, the
operation was successful. For more on this aspect of DOS commands,
see DOS Exit Codes. Also see the
"Double Pipe" symbol farther on.
- [ @ ] (Asperand or At) (ASS-perr-and) This sign is used in
batch files to prevent the text following it on the same line
from being displayed on the screen. An example is "ECHO OFF". It
is used at the start of most batch files to turn off screen echoing
(displaying) for all lines following. Employing `@' with it
as @ECHO OFF, will prevent this Asperand and the words
"Echo Off" from appearing on screen.
As well as the above, `@' is used by 4DOS to designate variable
functions. @FILEDATE will return a file's date, as an
Finally, the `@ sign is employed to designate file lists in
many versions of DOS. DEL @FILENAME.lst means that DOS
will delete the files listed in "FILENAME.lst".
- [ * ] (Asterisk) (ASS-ter-isk) (Erroneously referred to as
"Star".) DOS uses this as a wild card to represent one or more
characters. So *.txt would mean all files with an extension
of "txt". READ-ME.* means all `Read-Me' files with any
extension. They typically would be "READ-ME.txt" or "READ-ME.doc".
A*.txt means all files with an extension of "txt" that
begin with the letter `A'. Some versions of DOS allow an Asterisk at
the start, as well: *-ME.doc means all files with an
extension of "doc" that have "-ME" at the end of the file name.
Some DOS versions use this sign coupled with a percent sign
(%*) to represent all parameters on the command line in a batch
In DOS SHELL, the Asterisk key is used to expand an entire
directory level. Coupled with the Control key, it will expand
the entire tree to display all subdirectories under all
directories. (Other shells work this way, as well.)
- [ \ ] (Backslash) The Backslash is used in the path as a
separator between the drive and first directory and between
directories themselves. C:\BATCH\TEST designates that the
TEST directory is a subdirectory of BATCH, and that both reside
on the `C' drive.
The Backslash by itself represents the root directory. So
CD \ means to change to the root directory of the current
The Backslash is used in older versions of DOS when one
cancels a command line. It appears at the end of the cancelled
line with the cursor dropping down to the next line ready for
Another usage is by issuing ECHO\, a blank line will
be placed on to the screen in some DOS versions.
- [ ^ ] (Caret) (KAIR-ett), also referred to as the "Circumflex"
(SIR-kum-flecks). It is a representation of the keyboard "Control"
key. So ` ^C ' means "Control C".
4DOS also uses the Caret as a command separator when one is
issuing multiple commands on the same line.
- [ : ] (Colon) (KOH-lon) This is used as a drive-letter
designator. So ` E: ' means the `E' drive.
The Colon is also a label precursor in a batch file:
(more batch commands)
This batch file snippet says to go to a label called "END",
skipping any remaining batch commands. DOS finds it by looking for
a single Colon and the matching text following.
Another usage that may be seen is by issuing ECHO:.
Here, a blank line will be placed on to the screen in many DOS
In 4DOS, comments can be added to a list of variables that have
been written to a file by starting the comment line with a Colon.
Finally, the Colon is a time delimiter that separates the hour,
minute, and second: 10:15:00 AM.
- [ :: ] (Double Colon) Employed in batch files to allow comments
to be inserted. Comments are used to instruct those reading the code
about various parts of the file. Text from a second colon onward
is ignored by DOS and is not executed or displayed. This is
because a colon is an illegal character within a label name. (Labels
use only one colon, as discussed above.)
- [ , ] (Comma) (KOM-mah) This can be used by the FOR command to
separate items in the set contained within the parentheses.
FOR %N IN (1,2,3) DO ECHO %N.
The Comma is used to separate file names for those commands
which can accept multiple file specifications.
Some versions of the MOVE command allow multiple files to be
moved by separating them with commas:
MOVE FILE-1,FILE-2 C:\ARCHIVES
In many DOS versions, "ECHO," will produce a blank line on the
- [ - ] (Dash) (Also called "Hyphen".) Erroneously referred to
as "minus" (see farther on), this symbol is used as a switch
designator in some DOS programs. In the following PKZIP example,
PKZIP is requested to make a compressed archive called "BACKUP.zip"
from all the files in the current directory that have the "Archive"
attribute set. (The `i' stands for "Incremental".)
PKZIP -i BACKUP *.*
The `-i' is a switch used to modify the operation of PKZIP. In
this case, it requests that PKZIP be more selective as to which
files it places into the compressed archive. Only those with the
"Archive" attribute set will be selected with this example. (See
DOS Switches for details on using
Another Dash usage is as a date delimiter. That is, it separates
the digits represeting the year, month, and day: 2022-01-31.
The Dash can be used as a word separator in file names on
systems that don't allow spaces: MY-FILE.txt.
(The Underscore may also be used for this purpose.)
- [ $ ] (Dollar) This is used with the "PROMPT" command to place
text on the screen as part of the DOS prompt. It can also control
the location of that text and its colours when used to produce the
"Escape" character via `$e'. (See "Escape", farther on.) As
examples, "PROMPT=$p$g" will show the current path followed by a
"Greater Than" sign ( > ), and "PROMPT=$p$t" will show the
current path followed by the current time. See your DOS manual or
on-screen "Help" for more.
The Dollar Sign is used by DOSKEY and Toddy as a command-line
parameter designator. `$3' represents the third parameter.
DOS itself uses the dollar sign within the file extension
to identify temporary work files.
- [ . ] (Dot) Erroneously referred to as a "period", this
character is used as a separator between a file's name and
its extension: FILE.ext. (See "Point", farther on.)
As a short name, the Dot can represent the current directory. It
appears in directory listings but can be used at the command line
any time one needs to refer to the current directory. DIR .
is the same as DIR *.* or DIR .\. DEL .
means to delete all of the current directory's files. Placing a
subdirectory name followed by a slash and the Dot would mean the
subdirectory itself. CD TEST\. is the same as
CD TEST, but allows the usage of a trailing slash when
generated by certain processes. (Most DOS makes and versions will
balk at a trailing directory slash by itself.)
Another Dot usage is as a date delimiter. The dash is the
default, but the Dot can be used to separate the year, month,
and day: 2022.01.31.
Finally, by issuing ECHO., the Dot can be made to output
a blank line to the screen in most DOS versions.
- [ .. ] (Dot Dot, or Double Dot) Represents the parent directory.
It appears in directory listings but can be used at the command line
any time one needs to refer to the parent directory. DIR ..
is the same as DIR ..\ or DIR ..\*.*.
DEL ..\ means to delete all of the parent directory's
files. One may refer to the grandparent directory as "..\.." .
- [ ... ] (Dot Dot Dot, or Triple Dot) Represents the grandparent
directory in some DOS systems and utilities in addition to
"..\..". (See "Ellipsis", next.)
- [ ... ] (Ellipsis) (el-LIP-sis) This is used in DOS SHELL
menus to represent that the selection will require more input
from the user. Selecting such an item means that a prompt will
appear requesting information from the user before the operation
will be carried out. (See "Dot Dot Dot" above.)
- [ = ] (Equals) (EE-kwals) Used to place items into the DOS
environment via the "SET" command.
SET PATH=C:\;C:\BATCH;C:\DOS tells DOS it can look in the
ROOT, BATCH and DOS directories for executable files.
SET FILE=BACKUP makes an environmental variable called
"FILE" that will substitute "BACKUP" anywhere "%FILE%" appears.
(See DOS Variables for more information.)
The FOR command can use the Equals Sign to separate items in the
set contained within the parentheses:
FOR %N IN (1=2=3) DO ECHO %N.
With some DOS versions, ECHO= will produce a blank line
on the screen.
- [ == ] (Double Equals) The "IF" conditional uses this to test
if two strings are equal:
IF "%1" == "" GOTO HELP
means that if the first parameter on the command line after the
batch file name is equal to nothing, that is, if a first
parameter is not given, the batch file is to go to the
This may be reversed by placing "NOT" after the command:
IF NOT "%1" == "" GOTO ACTIONS
So if the first parameter is not equal to nothing, that is, if it
is equal to something, the batch file is to go to the ACTIONS
- [ $e or <- ] (Escape) (eh-SCAPE) This combines with
the Left Square Bracket ( [ ) (see farther on) to create "Escape"
sequences ($e[ or <-[). It prefaces codes that
can clear the screen, place certain text such as Time and Date, on
to the screen, position the cursor, change screen and text colours,
and redefine keys, among other purposes. An example is:
<-[1;37;44m. This changes the screen colours to
bright white on blue.
<-[0m resets to the default white on black.
See "$" (Dollar), farther back.
- [ / ] (Forward Slash) This symbol is used as a switch designator
in most DOS versions and programs. DIR /W tells DOS to
display a directory in a wide format. (See
DOS Switches for details on using
The Forward Slash is used in some versions of DOS in the FOR
command. It represents an escape character and can be used to parse
Another Forward Slash usage is as a date delimiter. The dash is
the typical default, but Forward Slashes can be used to separate
the year, month, and day: 2022/01/31.
In some DOS versions, issuing ECHO/ produces a blank
line on screen.
- [ // ] (Double Forward Slash) 4DOS uses this to state
directives at the command line. It can overide a start-up
directive such as one within an INI file. Thus a new option
value can be given without having to modify an existing
- [ > ] (Greater Than) (Also used as a right angle bracket.)
The Greater Than symbol allows one to direct output to a file or
device. DIR > DIR.txt directs the file list produced
by DIR to a file instead of the screen. One may also send text to
a file directly from the command line via ECHO (whatever) >
WHATEVER.txt. In either case, a new file is automatically
created, overwriting any existing one without confirmation.
TYPE DIR.txt > PRN directs the file contents to the
printer port instead of the screen.
As a Right Angle Bracket, it is used in conjunction with a left
angle bracket to designate a Directory in a DIR listing:
BACKUP <DIR> 11-17-08 9:09p
- [ >> ] (Double Greater Than) This works partially the same
as the single Greater Than symbol by allowing one to direct output
to a file, but not to a device. However, in this case when output
is directed to a file via Double Greater Than symbols, any existing
file contents are not overwritten.
As with the previous examples, DIR >> DIR.txt
and ECHO (whatever) >> WHATEVER.txt direct text to
a file instead of the screen. If these same commands were to be
immediately issued again, the resulting files would be appended to
the first text; because of the double symbols no text is overwritten.
So for the latter example of the reissued commands, each resulting
file would contain two copies of the same information, one after the
other. Repeating them for a third time would add on yet another copy
of the information after the first two. In actual operation, the idea
of this double symbol is to keep adding different information to the
existing file, such as with a log.
- [ [ ] (Left Square Bracket) A character used in PROMPT and
ANSI.sys escape sequences. See the "Escape" character, farther
- [ < ] (Less Than) (Also used as a left angle bracket.)
The opposite to the `>' symbol, "Less Than" takes input.
MORE < WHATEVER.txt will display the contents of
WHATEVER.txt and pause after each screen fills. MORE is taking
its input from the file WHATEVER.txt.
XSET /LOAD < ENVIRO.def will direct XSET, an update
to the "SET" command, to load a default environment file. XSET
takes its input from the file "ENVIRO.def" via the "Less Than"
redirector. That input is the list of environment variables to
As a Left Angle Bracket, it is used in conjunction with a right
angle bracket to designate a Directory in a DIR listing:
BACKUP <DIR> 11-17-08 9:09p
- [ - ] (Minus) (MY-nus) Erroneously referred to as "dash" or
"hyphen" (see farther back), this symbol is used to reverse the
action of a switch by preceding or succeeding its character with
a Minus Sign. As an example, DIR /O:N tells DOS to display
a list of files in a directory and to show them in alphabetical
order from `A' through `Z'. DIR /O:-N will display the
same thing, but show it in order `Z' through `A'.
In the PKZIP example shown earlier, one may tell PKZIP to NOT
turn off the archive attribute after placing files into a
PKZIP -i- BACKUP *.*
Note that the `-i' switch action has been reversed by placing a
Minus Sign after it as "-i-". It would be read as "dash i minus".
The Minus key is used in DOS SHELL (and in many other shells)
to collapse a selected directory tree.
- [ # ] (Octothorpe) (AWK-toh-thorp) Also referred to as the
"Number Sign" and by other names for non-DOS purposes(*), DOS
uses this symbol when it "deletes" a file. "Deletes" is in quotation
marks because DOS does not really delete (remove) files from a disc
when DEL is used. Instead, it changes the first character to an
octothorpe, removes the file's reference from the File Allocation
Table (FAT), and releases the disc space for other files to occupy as
necessary. If the "deleted" file is still complete (not partially or
wholly overwritten), undelete utilities simply rename the first
character, mark the disc space as used and restore the listing to the
File Allocation Table. (Note that if one eventually deletes two files
in the same directory that have the same name, or two that are the
same except for the first character, DOS will use another symbol to
denote deletion since the Octothorpe would then be in use.)
(*)This symbol goes by different names when used for
non-DOS purposes. As an example, Twitter designates
the name for this symbol in its software as "hash tag".)
- [ ¶ ] (Paragraph) (Some of you may not see this character
with your browser.) It looks like a stylised `double T'. In DOS and
some other systems, you should be able to see the actual symbol by
issuing `^T' at the command line, or via the key combination of
Alt-20. Be sure to use the number pad to enter the `20'.)
`¶' is used by some DOS versions to allow multiple commands
to be issued on the same line at the DOS prompt. A simple example
D: ¶ CD \TEMP
...would log onto the `D' drive, then move down into the D-Drive's
- [ ( ) ] (Parentheses) These are used within the FOR command to
define the boundaries of the set. That is, items contained with
an opening Parenthesis and closing Parenthesis are called the "set"
and they are upon what the FOR commands acts.
A single Parenthesis is sometimes used by some DOS users in
conjunction with the ` == ' (Double Equals), but it had fallen
into disuse, having been supplanted by the ` " ' (double quote).
Its purpose, as is with the quotes, is to prevent an error should
a parameter not be given or be nothing. It means that there will
always be characters able to be compared on each side of the
IF )%1 == ) ECHO No Parameter Given
Finally, Parentheses can be seen in the DIR output on the line
giving the number of files in the listing:
40 File(s) 3,465,453 bytes
- [ % ] (Percent) is used to denote a variable. It is followed
by a number from 1 through 9. DEL %1 tells DOS to delete
the file name that was typed after the batch file name on the command
line. `%0' may also be used. It is a special version. It represents
the batch file name itself, unless the SHIFT command has moved other
parameters into that position. For the latter, if parameters
have been shifted, `%0' then acts as any other Percent-number
A single Percent sign is also used at the command line with the
"FOR" command. It is followed by a single letter, although some
newer DOS versions allow multiple letters.
FOR %F IN (*.BAK) DO DELETE %F
This tells the FOR command to look for each .bak file in the
current directory and to delete it. `%F' represents each of the
.bak files in turn during the delete process.
- [ %% ] (Percent Percent, or Double Percent) is employed in the
"FOR" command when it is used within a batch file. It represents
the variable used in that command. It is followed by a single
letter, although as stated above, some newer DOS versions allow
FOR %%F IN (*.BAK) DO DELETE %%F
This same example as in the Single Percent explanation tells the
FOR command to look for each .bak file in the current directory and
to delete it. `%%F' represents each of the .bak files in turn during
the delete process.
The Double Percent is also used when one must direct a percent
sign to another file from within a batch file:
ECHO DEL %%1 > TEST.BAT
When viewed, the file "TEST.bat" will show this as "%1".
- [ % % ] (Two Percents) are used to denote a variable in most
versions of DOS. One each is placed at the beginning and end of the
variable name. SET NAME=NATASHA means that everywhere one
wants to use the variable "NAME", it must be shown as "%NAME%". In
this example, DOS will substitute "NATASHA" everywhere it sees the
- [ | ] (Pipe) This is used to pipe (direct) one program's output
to another program as an input for further processing. "DIR | SORT"
will send the file list generated by DIR on to the SORT command to
allow it to be organised. TYPE FILE.txt" | XSET /LINE 1 TEXT
sends FILE.txt to XSET which looks at the first line and saves it
as the variable "%TEXT%".
- [ || ] (Double Pipe) Used by 4DOS as a special type of
command separator. It is used between two commands where one wants
the command following `||' to be executed only if the first command
is not successful. This will work only with a command used before
`||' that returns an exit code of `1' or higher. If exit codes are
employed, anything higher than `0' (zero) typically represents
something other than complete success. For more on this aspect of
DOS commands, see DOS Exit Codes. Also,
refer to the "Double Ampersand" symbol farther back.
- [ + ] (Plus) The COPY command uses the Plus Sign to allow files
to be combined into one large one:
COPY FILE1 + FILE2 + FILE3 BIG-FILE
The Plus Sign is also used to invoke file attributes of Archive,
Hidden, Read-Only and System via the ATTRIB command.
`+' may be seen used in some commands' switches. The DR-DOS
"SORT" command uses it to designate upon which column to base
its sort via the `/+n' switch, where `n' is a number.
The Plus key is used in DOS SHELL to expand one directory
- [ . ] (Point) Erroneously referred to as a "period", this
character is used as a separator between a software's
main version number and its update number. An example would
be DR-DOS 7.03. This would be pronounced "dee-arr doss seven
point zero three". (See "Dot", farther back.)
- [ ? ] (Question) is used by DOS as a wild card. Unlike the
Asterisk, it represents a single character only. So
READ?Me.txt means all .txt files beginning with "Read",
followed by any single character and ending with "ME". Thus, it
would cover "READ-ME.txt" as well as "READ_ME.txt".
Coupled with the Forward Slash ( /? ), the Question Mark
is a common switch character that will give brief help with a
command or utility in most DOS versions and programs.
A single Question Mark entered on the command line will show
a list of available commands in some DOS versions.
Another usage in some DOS versions is to allow prompting in
the DOS start file, CONFIG.sys. The following line in a DR-DOS
(dee-arr doss) CONFIG.sys will prompt the user as to whether to
load ANSIPLUS or not:
Be aware that other DOSes using this feature may require the
question mark be placed elsewhere on the line.
- [ ?? ] (Double Question) is an internal variable used by 4DOS
to give the reason the last program terminated.
- [ ' ] (Quote, Single Right ) The Right Single Quote is
used in some versions of DOS in the FOR command. Some DOS utilities
use it to delimit text.
- [ " ] (Double Quote) These are used in pairs to surround
a long file name, a text string, or in batch files as part of
the "IF" conditional.
DELETE "MY FILE.TXT"
FIND "DOS Version"
IF "%1" == "OK" GOTO END
Some versions of DELTREE can use Double Quotes to surround
illegal file or directory names in order to delete them.
- [ ; ] (Semicolon) Employed in configuration and some script
languages to allow remarks (comments) to be inserted. Comments are
used to instruct those reading the code about various parts of the
file. Text after a Semicolon is ignored by DOS and is not executed
or displayed. One may use the semicolon for this purpose in
This character is used to separate items in the PATH
The Semicolon is also used in ANSI "Escape" sequences to
separate code strings. (See "Escape", farther back.)
The FOR command can use the Semicolon to separate items in the
set contained within the parentheses.
FOR %N IN (1;2;3) DO ECHO %N.
Under some DOS versions, "ECHO;" will produce a blank line on
- [ ] (Space) DOS uses this to delimit text, and commands
and their switches or parameters.
The FOR command can use spaces, among other characters, to
separate the items in the set.
FOR %N IN (1 2 3) DO ECHO %N.
Some DOSes could produce a blank line on screen with
"ECHO " (ECHO Space Space). However, this seems to
have been retired in all versions since about the mid 1990s.
- [ ~ ] (Tilde) (TILL-dh) (The second syllable is only lightly
prononced.) A symbol to denote the missing part of a long file
name when viewed on a system that only supports eight-character
SPRING-BACKUP.TXT becomes SPRING~1.TXT
SPRING-BACKUP-FINAL.TXT becomes SPRING~2.TXT
- [ _ ] (Underscore) is used as a word separator in file names on
systems that don't allow spaces: MY_FILE.txt. (The Dash
may also be used for this purpose.)
The Underscore is also used by 4DOS in place of two percent signs
to designate internal environmental variables. _DATE
represents the current date, as an example.
As mentioned at the start, there are additional uses for the
preceding characters; plus there are additional symbols not
discussed here. If you feel there are some that should have
been included, feel free to send an
e-mail with your
suggestions and the reasons for inclusion.
Learning to use these symbols will add to your
DOS tool kit. You will gain extra power at the
command line and within batch files and macros.