4 Batch Processing
In this
chapter
you will learn:
•
How
to
create
a
batch
file
• How an
autoexec.
bat
file works
• How
to
use replaceable parameters in a batch file
•
How
to
run a batch file
• How
to
do
multitasking with batch files
Note
If
you are not writing batch programs you
do
not
need
to
read
this chapter.
Why Use Batch Files?
You may often find yourself repeatedly typing
the
same
seque~ce
of
commands
to
perform
some
common
task. With MS-DOS you
can
put
this command
sequence
into a special file called a batch file,
and
then
run
the
whole
sequence
of
commands
by
simply typing
the
name
of
the
batch
file.
Note
that you
don't
need
to
type
the
batch
file's extension,
even
though all
your
batch files must
include
the.
bat
extension in their filenames.
MS-DOS performs these "batches"
of
your commands just as
if
you
had
typed
them
from
the
keyboard. This is called batch process-
ing_
By
using a batch file, you only have
to
remember
to
type
one
command, instead
of
several. In effect, you use batch files
to
create
personalized commands.
How to Create Batch Files
You
can
create
a batch file by using
edlin,
the
MS-DOS line editor,
or
by using
the
copy
command.
If
you
want
to
create
files
with
edlin,
you should refer
to
Chapters 6 and 7 for
more
information.
The
examples in this
chapter
show
you
how
to
use
the
copy
command
to create batch
files_