Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Version ,2.11
Advanced User's Guide
CHAPTER BATCH
BATCH PROCESSI
THE AUTO EXEC BAT F
2. How to an
2.3 CREATING FI
2. .BAT
TABLES
".- MS-DOS .Advanced Co_ands It-2
"'-2 SORT Table
v
is guide
ng
1ed i ."'lIIl"."."
commands.
is guide assumes you have:
o
The . . . . . . . . . . . . . . . . . . . . . . . . . . . . . --.. . . ."""'"'"' . . . ~~ . . . .
organ
and
2 D batch ng
vi i
01
Th s discusses
how to file names
structure.
1 1 DI
In
d
director i
thees
way of d
1-
D RECTOR I AND PATH'S
F g'ure 1 1: A e H erarchi
1. A
N
01
D
1.2.
mp
ona
an
names
prev
ts
Ind
DI
lA fu 1 This one
be file named lA in the
named bel ng to the
named MARY.
A
or
of the
working
t
DI R
DIR
R
b
s ow.
into
DIR
d
4 Di
CHDI
you will
A:
dr desi on
DI A.ND
drive D
of A:
<DIR> 10:
IR> 10:
<D R> 10:
ILEl COM 9:
4 free
Because 1 and es
previous displ MS-DOS you to g
i "'_~""'i/I!l"''' the same name as a
example, you have
you cannot create
MKDIR NEWDIR
110
DI
.2 to D
You
to
.2.7 to
To
the
RMD R
R
2
This
then
f
the same
a common
2. 1
a batch
the COpy
.BAT F
on usng create
2-1
NG
NEWD
The result is the same as if each of the lines in the BAT
f 1e was at the termina as individual commands.
Fi 2-1 ill used wri
and execute an batch fi le.
2-2
F
4. press wh 1 n batch mode, th
appears
nal batch
the
f the
ends
command n
11
MS-DOS ime
and date
AUTOEXEC. BAT are
If,
run
cou
.3 A FI WI
i e cop ed
A>
2. the as part a
! you must t
examp e to speci the fIe
you must it as in, the
.MAC
MYF A 1B
10
The the
MYFI
3-
3- 1
1
ION INPUT AND
DR
to a file named
MYF file on the command line
DI R>MYF I
does creates
your di If MYFILES
overwr Ie
new data
your di or f e another
rep1 ing the entire two
can be used to tel
command a
the end of iedile. The command
D R
to currently ex
not exist. t s
to have
from
using a less-than
command
>LI
and sor a f Je
3.1 2 Fi1
A fi 1teri
in sOlIe
or to a fi
i 1.. ",,a#lll11l'1I
textn f
di t,
text
can n on
3.1.3 ip
Piping is p
() For
IREC
MORE
one screen
your
You p Iter
tOflY'lANIJS
sts the
to use
commands " and
ADVANCED COMANDS
Table lists the
Ie 1: Advanced
Connand
BREAK check
IR directories; pri di
console
a COIllniina
f or
f
FT
or DatCk,,,ar'G
Interna
CTRL-C
BREAK
OFF sw liS-DOS
BREAK.
TYPE
IR DI Internal
SYNONYM
CD
SYNTAX
CHDIR
want
as
IR
SYNTAX
CTTY ice>
COMENTS
The i are giving
is useful f you want
to you are wo,rk i The
AUX
PURPOSE
Turns batch echo on and off.
SYNTA.X
ECHO IOFFI
COMMENTS
comm,ands ina batch f il e are displ
on the console when are seen by the
command processor. OFF turns off this feature.
ECHO ON turns the echo on.
If ON or OFF are not specified, the current setting is
displayed.
f i lei to format.
a saving of d sk faster
SYNTAX
N <d:><fi ename><.ext> :]
COM programs
1i
cannot be conver
CS: P do,es not meet either of criteria
specified above, or t meets the .COM f Ie
criterion but has xups. This message is
also displ if the file is not val d
executable fil
10
File
is to run N.
icient disk
s not disk to create a new
Ie.
-base
source (. conta ned nformation
i ca.t i ng that a is required for the
1e i at
ich the fini
i 1e be conyer ted
- Read error on f Ie
read less than size n header
is is a warning y.
COHl-tANDS
NAME
IT Internal
PURPOSE
Ex ts command
and returns to a previous level, if one exists.
IT
12
FIND
SYNTAX
3
ADVANCED COMMANDS
The command
DIR B: I FIND IV IIDATII
FIND: error
You an illegal string when issuing the FIND
command.
FINO: Fi 1e not <filename>
filena.e you ified not 5t or
ND cannot find it.
5
ADVANCED MS-DOS COMMANDS
NAME
FOR Internal
PURPOSE
Command extension used in batch and interactive file
......",....... i ng.
SYNTAX
F IN <set> DO <command> - for batch processing
FOR IN <set> <comm,and> for interactive
processing.
COHI1.ENTS
<set> is
NOTE
16
N ( Ie.)
F IN BAR
only I
would i was an
error throw out the' :1
so that the would never see t. the
is in a then only one should be
17
ADVANCED MS-DO'S COMMANDS
NAME TYPE
GOTO Internal,
PURPOSE
Command extension used in batch file processing.
SYNTAX
GOTO <label>
COMMENTS
:foo
REM looping
GOTO foo
wi 11 an Infinite sequence of messages: REM
looping
Start ng a line in a batch f 1e with I:' causes the
line to be ignored by batch processing. The characters
following GOTO define a label, but this procedure may
also be used to put in comment lines.
18
NAME
in. f 1e
1 F t i oh> <command>
tion>
if and only if ition> is false.
The IF statement 110ws condiional execution of
When the <condition> s true then the
is executed. se, the <command> is
19
ADVANCED MS-DOS COMMANDS
NOTE
The words ERRORLEVEL t EX I ST t and N'OT must be
uppercase.
Examples:
PURPOSE
The to
2. 11 l!oader on
disk is a
of the
places
SYNTAX
nationdrv:>
ination ve is ve or hard
ive that you want to oader on.
ace the 1 on asketteor a hard disk
ion that contains f les.
eop ies the 1aader and 188V'8S the f i 1 es
NAME
MEDI
access to diskettes
MEDIACHK
When you the MED ACHK command with the OFF swi
Rainbow no longer checks to determine the
d skette1s fo~mat. This the
access to the
I4KDR Internal
SYNONYM
KD
KKD R
IR
IR
COMMANDS
NAME
MORE
PURPOSE
MORE
d ay another screen
on. This continues unti all the
data has been read
MYF I COM
wi 11 display the f 1e MYFILES.COM the
default dri one screen at a time.
Internal
SYNTAX
PATH
d
unt il set another
You can tell one
speci ng several by semicolons.
1et
PATH IN\DEV
tell s the directories specified
above find external commands.
searches the in the order specified in the
PATH command.
The command with no ions will print the current
If you spec i PA.TH; , wi 11 set the NUL
, mean ng that only the work will be
searche,d for externa 1 commands.
nterna)
execut on the f e.
AX
ike a when
If press wI be
di
1
If Y in to th s execut
the inder of batch wi be
and wi 1 returned to ng
level. Therefore, used to break a
batch f i 1e into e.ces ,a owi ng you to end the batch
file at an intermed ate pont.
comment is ional may be entered on the same
ine as You may Iso want to the user of
the batch f 1e with some meani the
batch f Ie pauses. For example, you may want to
disks n ~ne of the drives. An ional
may be g yen n such cases. The comment will be
displ the ike message.
NAKE
the
SYNTAX
COMENTS
This the
If no text
will be set default
defau 1t dr i ve ion. Yo,u can
spec as the current using
characters indicated below.
use the command with the ion, be
you spec I an existing dr ve. If you use
ion th a non-ex i stent dr ive" you could see
resu ts.
COMMANDS
To Get This
les:
PROMPT
the default drive letter
PROMPT Time $
Sets a two-line prompt which prints:
Time rent time)
Date (current date)
PROMPT [7mSn: [m
the in inverse video mode and
returns to normal video mode for other
text.
a file or an entire disk containing bad
<filename I d:>
<filename>
11 cause to
and to ski the
finds the sector ,the sector
will no onger allocate
To a d sk,
<d:>
NOTE
You should use RECOVER only as a last resort.
could misi data that may not be
Th s could lead to unpredictable
MAKE
REK Internal
REM
NAM,E TYPE
RMDIR (REMOVE DtRECTORY) Internal
SYNONYM
RD
PURPOSE
Removes a d i ......."" .......... 1 from a hierarchical di .....,'.. JiIIIl.... "'1
structure.
SYNTAX
RMDIR
COMMENTS
Th s command removes a di empty
for the. and shorthand
To remove the d i ....,......"..,...... first issue a
DIR command for that path to ensure the d i --"............ _.. . '
does not contain any important files you do not
want deleted. Then
RMDIR
The d i -_ " has been de 1eted f rom the d i ....,.. '... "" ..""
structure.
NAME
Internal
PURPOS'E
access to.18ore 10 1e in
i1e processing.
SYNTAX
1FT
f
%1
%1
PURPOSE
SORT reads input from term; na 1, sorts the d.ata,
then writes it to your terminal screen or fil
SYNTAX
SORT [/+n]
COMMENTS
SORT can be example, to ize a file by
a certain columin. There are two switches which allow
you to select ions:
reverse the sort; that is, sort from Z to A.
sort starting with column n where n is some
number. If you do not specify this switch.
will in sorting from colum'n 1.
reads and sorts in the order described in Table
4-2.
ADVAN'CE.DKS-DOS COMANDS
Examples:
/R <UNSORT.TXT >SORT.TXT
DIR 4
The command
ION
It is to files on If
you have e and later want to es to
see which you can use F Ie
i son
...""111..,4
name of the
Fe .atehes
I I ..., ltilll'II ,
filenames
FI ~
. . . . ...... IlII". . . 'u of disk dri ve
B: and d
Sineeno dr assumes that
\BARd t ....""" .. IlII"Ii.fLl the It drive.
FI COMPARISON UTILITY (F
5.4 FC SW
There are four switches that you can use with the File
Compar i son Ut i 1 i ty::
e lin a
11
and
wi 11
fi ed, then Fe
&IIIRlDe,
11
lename >
<difference>
<1st ine to f i I e2 in file >
__,-_.__.. _ .... -c:1'" i ename2>
<difference>
1st line to match file n f il e2>
5.6
two i es, you
unless you red rect
in sam,e
To COinDelre theFC to
DIF
FC Fi F i 1e2
5.7 EXAMPLES
di 1
screen. A 1 other Its
ere: use tabs,
do. c~IDllrison on the
D
E contains
F contains g.
G
M f i1
N contains mno where
o contai'ns J 12.
P
.ASM
J
1
2
P
w f 1e
conta ns w'where
BETAns
it
5
w
F LE COMPAR UTILITY
----------ALPHA.ASM
D
E
F
G
H
I
M
N NOTE: p is the 1st of
o a string of ~ matches.
P
----------BETA.ASM
G
H
I
J
1
2
P
------------ALPHA.ASM
W NOTE:w is the 1st of a
------------BETA.ASM string of 4 matches.
!+
5
w
10
FI
forcesa d
on the the salle two
as were used in es
Fe .AS" ASH
The in is e bi i son.
This swi and any the
filenames Fe command fo low ng di ay
shou ld aDI:Jellr
OOOOOOOF
00000012
00000015 31
00000018
",,,,",,,",,,",,,,18
0000001E 51
",,,1..,,,,,,,,.. 1
0000002A
0000002D
lA
11,
FI LECOKPAR I S,O'N UTll (F c)
Inval id ion>
Invalid number of
You have specified the wrong number of ions on the
Fe command ine.
Bad f 1e
the files you specified s ive.
Internal error
This message indicates an internal logic error n the
Fe program.
12
6
LI
6. 1
This diSCUSSQS It s that
read ire use INK.
Source Source
Assembler
.OBJ
MS-LINK
libraries
LST
Used if
Run file is VM.TMP Run fi
.EXE
memory
Fi 1: The LINK
6. FINITI Ll
terms used in thi are exp ained below
understand how INK works. Genera ly, f you
mlodu 1es comp i 1ed f r o m e Pasca 1, or a
1anguage, y'ou wi 1 not need know these terms
wr ing compiling programs n assembl
language, however, wi 1 to un!derstand INK
nit descr bel
F y I Divi
e:
Name Class
Name
1
2
12
Each INK
loads rst
to
During ir
addresses does
this fi
a col that f t w n a
do not need to be
conti 1lustrat The address
of any lowest addre.. the n that
group. At link INK analyzes the groups, then
references the the address in of that
group. A may eo<ns i st of on,e orlllore groups.
6.4 FI INK
INK:
Produces two
For each of i ve
spec f cat on The INK iJ
i the same that
:]
where: on ve
0: The
as dr ve
6.4.2 ions
fol1 t extensions to
Li f les:
Run
.KAP L st
6.4.3 Fi 1e
65 TO NK
Method LINK
Method LINK
LI
6.5. 1 1:
start INK
LINK
INK 11 then
display II t lie. You
answer the spec f c
o
LI
6 2 2: Line
To start
1 ne.
cODIII1and
must be
LINK e>.<1 tch J
LI are to cODIII1and
e ds for the different must be
a 1 st 1i modu es be
ionalsw be
any of the ust
cODIII1as or as
B.L B
LI INK)
12
L
3: iF i 1e
LINK
where:
ts
entered from
1e thout
13
LINKER INK)
1e:
14
6.6
Plus si
us
f
owing
more
ibraries:
n. When
to be Ii es to be
been 1 i ste.d, response ine
e name and and a p us
e:
ieolan
To se eet default to
use si ngl e semi colon, (;) fol
carri return at any t me after
File: This feature saves time need
to a series of
15
LINKER PROGRAM
1e:
Kodules
FUN TEXT TABLE CARE<RETURN>
Modu I e ; <RETURN>
16
LI
message.
n square
wh ch can
[.
ect modules be nked.
that the f extens
i ename
be yen set the
I*\odu must be
that loads in
encountered. You _''11''.__'"''_,''' i onto
ich read
i1
7
THELI INK)
Ie:
Run Fi Ie B:
re!IDC)nS;e d i r e c t s l NK to create the Runfi1e
.EXE on dr ve B:. Also, NK wi 1 pause,
which 110ws you to insert anew disk to receive the
Run f le.
i 1ename.
18
II
19
LI PROGRAM INK)
programs.
LI
caly
actual a.ount
aMOunt all JfIIIIIiII.iIIf/IIII>41111 . . . . . . .
cau.e. ae.
b1ei n "".""pu 11 .... 1"'...,1 ,
as low as poss
th or
ude in the
soure.
I I ' r i. . . . . . . . . . . I , I n.
all that
in 1 I'II ....... PIIII ..... ion.n
, of includ. ine
LI NKER PROGRAM NK)
/HAP
d rects to 1st all 1)
Is defined in the i modules. is not
given, I NK will 1 i s t only (including
undefined global
CAUTION
s short for
tells INK to
1i i es in the if you
ing ing the
tch tells search
1i external
THE LI INK)
LINK
The 11 and
answers
Linker V2.00
Microsoft Inc.
l.
The
20-b
........",r .." ..... ion in the
address
ion zero is
---- Inn
columns the
re ative to locat on
of the load module.
not the absolute where
BAD NUMERIC
Numeric value is not in digits.
ERROR: DUP
DUP record in assembly language module is too complex.
Simpli DUP record in assembly language program.
LINKER
The size may not the numbe'r
of may not exceed
S ZE
than or equal to th
SEGM,ENT SI
6ltK is addressi I im t.
CAPACITY
names were
"'ANY IN :ONE
limit is 8 libraries.
MANY
The 1 i mit is and classes taken
VM READ ERROR
This is a disk error; it is not caused by INK
WARNING:
There is ect e or an has been
made to 1ink les that INK cannot handle
an lute eet modul
WRITE ON RUNFI
Usually, there s not disk space for the Run
fi Ie.
APPENDI X ,A
A-l
HOW TO CONFIGURE YOUR SYSTEM
A-2
A. CHANG IG. FI
This of sector that wi se
the list. If not set, 10 s a reasonab e
of f i 1es ca Is
can access. If not set 10 is a
CE- i I ename>
- or
If ON s specified default is OF
as i will be made every time
ON improves the to abort
versi ons of the .. ,L.'-- ~,
COUNTRY <number>
Th i s number i s set to a 11 ow for i nternat ionia 1 date,
time, currency, and case conversion. Acceptable values
are:
United 1t va 1ue)
1
France
in
Por
Italy
United Kingdom
49
81
Israel
A ical confi ion f Ie might look like this:
Buffers 10
Files 10
Device IN\NETWORK.
Break ON
1 A: N\COMMAND.COM A:\BIN /P
Note here that the Buffers and Files are set to
10. The initialization routine will search for the
filename \8 to find the device that is being
added to the system. This fi e is usually supplied on disk
with your device. Make sure that you save the device file
in the that you specify in the Device
not
COUNTRY
e also sets the to
located on disk IN
s where ook for
it needs to re-read from d sk te ls
that it is the first running on the
it can process the IT command.
+ INK command Commands .)
15 EX I,
INK command F NO, 13
15
GOTO,
fil e, how
SH
Batch
Batch
B nary
Buffer
dev
d
ing
CHO R, command
Classes, 6
Command pi
Command
for KS-L 7
Commands ng
CHD R, ,1-1,
COPY,
CTTY
DEL, 1 i
DIR, 1 hierarch -2
ECHO, making,
EXE2B N, remove,
ndex-
irector .)
removing, 11
-2 INK
wor ng. 1 ,1 defined,
sample
i
VM
reader most
IIDma 111111
SOFTWARE PUBLICATIONS