Chapter 6 / Command Reference
Example
The following batch file formats a disk in Drive B and then
checks the disk. (The file uses some external commands,
so
it
must
be
created
in
a
directory
that
contains
the
external
commands.)
copy
con
prepdisk.bat
I
ENTER
I
e c h 0 0 f f I
ENTER
I
rem
ThlS
formats
and
checks
dlsks
In
drive
E
IENTERj
rem
i
tis
cal
led
pre
p
dis
k .
bat
I
ENTER
I
format
b:
I
ENTER
I
echo
do
you
want
to
check
drive
b?
I
ENTER
I
pause
I
ENTER
I
c h k d s k
b:
I
ENTER
I
e c h 0 0 n I
ENTER
I
ffiJ
I
ENTER
I
When you
run
the file, MS-DOS displays:
echo
off
The FORMAT copyright is displayed, then the screen shows:
Insert
new
diskette
for
drive
E:
and
strlke
any
key
when
ready
...
Formattlng
tracks
Format
Complet'e
nnnnnn
bytes
total
disk
space
nnnnnn
bytes
available
on
dlsk
Format
another
(YIN)?
Do
you
want
to
check
Drlve
E?
Strike
a
key
when
ready
...
nnnnnn
bytes
total
dlsk
space
nnnnnn
bytes
available
on
dlsk
nnnnnn
bytes
total
memory
nnnnnn
bytes
free
As you can see,
the
commands are not echoed. The screen does
display
the
prompt
Do
you
want
to
check
Drive
E? This is
because
the
ECHO command used here includes
the
message
parameter.
76
i !