home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Hall of Fame
/
HallofFameCDROM.cdr
/
util1
/
smstr32c.lzh
/
SM07.DOC
< prev
next >
Wrap
Text File
|
1991-01-21
|
10KB
|
301 lines
-------------------------------------------------------------------------
SECTION 7 Batch Command Reference
-------------------------------------------------------------------------
7.1 Batch Primer
A detailed description of DOS or its function would be a
long and lengthy undertaking. So, in order to make this
text as brief and meaningful as possible, each individual
Batch command will be touched upon as it pertains to the
SYSTEM MASTER command Processor. (See the DOS Manual for
your particular version of DOS for detailed descriptions
of each of the following commands).
Batch Commands (Listing)(DOS ver 3.3 specific)
:label
@
%#
%string%
CALL
ECHO
FOR
GOTO
IF ERRORLEVEL
IF EXIST
IF s1==s2
PAUSE
REM
SHIFT
All Batch commands may be executed with the SYSTEM MASTER
shell using batch conventions.
Release Date: 21 January, 1991
-------------------------------------------------------------------------
System Master 3.2 Page 7- 1
-------------------------------------------------------------------------
SECTION 7 Batch Command Reference
-------------------------------------------------------------------------
7.2 Batch Command Descriptions
7.2.1 :label
The :label command is not a true command, but is
instead a tag to which GOTO instructions are
routed within a batch file. A 'label' can be any
valid label tag as described within your DOS manual.
Format: :label
Exampl: if NOT EXIST bogusfil.txt GOTO exitbatch
del bogusfil.txt
:exitbatch
cls
This example first checks for the existance of
a disk file called 'bogusfil.txt'. If the file
exists, it is deleted. if it does not exist,
processing jumps to the 'exitbatch' label and,
and the batch file clears the CRT and terminates
normally.
7.2.2 @
The @ command is not a true command, but it is instead
a filter which allows batch commands to be executed
without displaying the batch commands on the CRT.
This command is available starting with version 3.3
DOS. Using this command with earlier versions of DOS
will cause SYSTEM MASTER to operate incorrectly.
Format: @command
7.2.3 %n
The %n command is not a true command but is instead a
means by which DOS passes input parameters to command
files which use them. 'n' can be any positive integer
value in the range 1..9 (SYSTEM MASTER requirement).
Other normal DOS Input parameter passing requirements
remain in effect.
7.2.4 %string%
The %string% command is not a true command but is instead
a means by which program variables are passed to and from
the DOS environment. 'string' represents any valid
DOS Environmental variable assigned using the 'SET'
command.
Release Date: 21 January, 1991
-------------------------------------------------------------------------
System Master 3.2 Page 7- 2
-------------------------------------------------------------------------
SECTION 7 Batch Command Reference
-------------------------------------------------------------------------
7.2.5 CALL
The CALL command allows a batch file to be executed from
within another batch file without terminating the first
batch file. This command allows batch files to be
processed as commands within other batch files.
Format: CALL another.bat
This command is available starting with version 3.3
DOS. Using this command with earlier versions of DOS
will cause SYSTEM MASTER to operate incorrectly.
7.2.6 ECHO
The ECHO command has 3 functions:
1) to turn echoing of screen commands ON.
2) to turn echoing of screen commands OFF.
3) to display a text string on the CRT.
Format: ECHO ON
Format: ECHO OFF
Format: ECHO This String Will be Displayed!
7.2.7 FOR
The FOR command allows repetitive execution (Looping) of
DOS commands.
Format: FOR %%variable IN (set) DO command
7.2.8 GOTO
The GOTO command allows branching within a batch file.
when a GOTO command is encountered in a batch file
processing continues at the 'label' specified.
Format: GOTO label
Exampl: if NOT EXIST bogusfil.txt GOTO exitbatch
del bogusfil.txt
:exitbatch
cls
This example first checks for the existance of
a disk file called 'bogusfil.txt'. If the file
exists, it is deleted. if it does not exist,
processing jumps to the 'exitbatch' label and,
and the batch file clears the CRT and terminates
normally.
Release Date: 21 January, 1991
-------------------------------------------------------------------------
System Master 3.2 Page 7- 3
-------------------------------------------------------------------------
SECTION 7 Batch Command Reference
-------------------------------------------------------------------------
7.2.9 IF [NOT] ERRORLEVEL
The IF ERRORLEVEL command checks for errorcodes returned
from some DOS commands and provides those codes to the
batch processor.
Exampl: replace bogusfil.txt a:\
IF ERRORLEVEL 2 then goto :exitbatch
:exitbatch
echo File Not Found
This example first attempts to replace a disk
file called 'bogusfil.txt'. If ERRORLEVEL is 2,
processing jumps to the 'exitbatch' label, and
the batch file displays an error message and
terminates normally.
7.2.10 IF [NOT] EXIST
The IF EXIST command checks for the existance or non-
existance of a disk file.
Exampl: if NOT EXIST bogusfil.txt GOTO exitbatch
del bogusfil.txt
:exitbatch
cls
This example first checks for the existance of
a disk file called 'bogusfil.txt'. If the file
exists, it is deleted. if it does not exist,
processing jumps to the 'exitbatch' label and,
and the batch file clears the CRT and terminates
normally.
7.2.11 IF [NOT] s1==s2
The IF s1==s2 command compares 2 strings for equality.
Exampl: if %1==STEVE ECHO STEVE IS USING THIS SYSTEM
7.2.12 PAUSE
The PAUSE command suspends processing of the batch
file until the user presses a key. A Remark can be
tagged to the PAUSE command for command clarity.
Exampl: PAUSE Insert a New Diskette in Drive A
7.2.13 REM
The REM command displays remarks from within a batch
Release Date: 21 January, 1991
-------------------------------------------------------------------------
System Master 3.2 Page 7- 4
-------------------------------------------------------------------------
SECTION 7 Batch Command Reference
-------------------------------------------------------------------------
file. If ECHO is 'OFF' the remarks are NOT displayed.
Exampl: REM If ECHO is ON this remark will be displayed
7.2.14 SHIFT
The SHIFT command allows input parameters to exceed the
DOS limit of 10 (0..9).
When the SHIFT command is used, %2 param becomes %1 ...
and the last defined parameter becomes nul.
Release Date: 21 January, 1991
-------------------------------------------------------------------------
System Master 3.2 Page 7- 5