• You
can
use any
of
the
redirection
symbols « > < < > > ) in
a
batch
file. See
Chapter
2, "About Commands," for
more
infor-
mation
on
using
these
symbols.
• You
cannot
use
the
pipe
symbol
(I)
in a
batch
file.
• Setting
the
directory
or
drive affects
every
subsequent
com-
mand
in
the
batch
file.
• Setting
environment
strings also affects
every
subsequent
com-
mand
in
the
batch
file.
Note If you have
more
than
one
external
command
with
the
same
name, MS·DOS
wiU
run
only
one
of
them,
according
to
the
fol-
lowing
order
of
precedence:
.com, .exe, . bat.
Suppose, for example, that
your
disk includes
the
files format. exe
and
format. bat. If you
were
to
type
the
external
command
fonnat,
MS·DOS
would
always
run
the
programformat.exe first.
In
order
to
run
the
batch
file format. bat,
you
would
have
to
place
it in a separate
directory
and
give a
path
along
with
the
external
command.
What is
an
Autoexec.bat File?
An
autoexec.
bat
file lets you
run
programs automatically
when
you
start MS·DOS. This
can
be
useful
when
you
want
to
run
a
specific application
under
MS-DOS, and
when
you
want
MS-DOS
to
execute
a batch
program
each
time
you
start
your
computer.
By
using an autoexec.
bat
file you
can
avoid loading
two
separate
disks just
to
perform
these
tasks.
When
you start
your
computer,
MS-DOS
searches
the
root
directory
of
the
default disk drive for a file
named
autoexec.bat.
If
it finds
the
autoexec.bat file, MS-DOS immediately
processes
it, bypassing
the
date
and
time prompts.
If
MS-DOS
does
not
find
an
autoexec.
bat
file,
then
the
date and
time
prompts
appear automatically.
Hint MS-DOS
does
not
prompt
you for a
current
date
and
time
unless you include
the
date
and
time
commands
in
your
autoexec.bat file.
lt's
a
good
idea
to
add
these
two
commands
to
your
autoexec.
bat
file, since MS-DOS uses this information
to
keep
your
directory
current.
See Chapter 3, "MS-DOS Commands," for
more
information
on
the
date
and
time
commands.
Batch Processing 103
The autoexec.bat file