I"
I
I I
I '
r
;-
I
r
I '
,
i
\ '
r
,
Chapter 6 / Command Reference
Typfiles.bat displays
the
file Rental.dat,
then
pauses
and dis-
plays the message:
-
Strike
a
key
when
ready
...
Change disks
and
press I
SPACEBAR
I to display Sales.dat.
• Use pAUSE whenever you want
an
option to cease execution of
the
batch
file.
Suppose you create a batch file
that
combines
all
current
directory files
that
have the extension .lst into
the
file All.lst.
If
the
file All.lst already exists the
copy
will destroy the origi-
nal
contents of All.lst.
To
avoid destroying All.lst, create
this
batch file:
copy
con
comblist.bat
[ENTERJ
REM
This
file
combines
*.lst
files
into
all
. 1 s t I
ENTER
I
ECHO
OFF
I
ENTER
I
IF
EXIST
all.lst
ECHO
all.lst
already
exists.
Pre
s s
[C
TRL- C1
toe
n
d,
0 r
[ENTER
I
PAUSE
I
ENTER
I
ECHO
ON
[ENTER
I
COP
Y
*.
1 s
tal
1.
1 s t I
ENTER
I
[ill
I
ENTER
J
If
All.lst exists and you execute
the
batch file, MS-DOS
pauses
and
displays
the
message:
all.lst
already
exists.
Press
[CTRL-Cl
to
end
or
Strike
a
key
when
ready
...
If
All.lst does not exist, MS-DOS pauses and displays only:
Strike
a
key
when
ready
...
141