" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#008000" VLINK="004000" ALINK="#00C000">
PECULIARITIES OF BATCH FILE PROCESSING WITH PTS-DOS SHELL
Such processing has some particular features as compared to standard
procedure.
First and most important among them is that the Shell launches a
special process for batch file executing and terminates it when batch file
processing is interrupted for some reason. This has some consequents:
1. All batch files accessed for processing from the given one, upon their
termination return the control back to the given batch file.
2. Re-directing "console" device command is a local one for the batch
file, i.e. after the batch file is processed the state of standard
I/O devices is restored.
3. There is a possibility to use redirection of input-output flows for
the batch file as a whole.
Another particularity is the use of reserved names while processing DOS
environment variables. If the following "names" are used as environment
variables names after % symbols:
DIR, NAME, DIRNAME, EXT;
then the line processing proceeds as follows. The parameter immediately
following such a "name" is considered to be the full variable name. A part
of the this variable name is to be used in the command, while the rest is to
be omitted. The remaining parts of variable names are correspondingly: file
directory, file name only (without extention), file directory and name
(extention is omitted), filename extention only.
The other special feature is the access to the canonical full name of a
batch file under processing. Reference pseudoparameter "%$" is used for this
purpose.
Example:
Suppose there is TEST.BAT file on drive C: in \DIRBAT\ directory.
executing the following
lines of the given batch: will cause the output:
@echo %DIR% %$ C:\DIRBAT
@echo %NAME% %$ TEST
@echo %DIRNAME% %$ C:\DIRBAT\TEST
@echo %EXT% %$ BAT
@echo %$ C:\DIRBAT\TEST.BAT