SET(DOS) UNIX System V SET(DOS)
Name
set - sets one string of characters in the environment equal
to another string for later use in programs
Syntax
set [string=[string]]
Description
You should use set only if you want to set values for
programs you have written.
When MS-DOS sees a set command, it inserts the given string
and its equivalent into a part of memory reserved for the
environment. If the string already exists in the
environment, it is replaced with the new setting.
If you specify just the first string, set removes any
previous setting of that string from the environment. If
you use set without options, MS-DOS displays the current
environment settings.
When batch processing, you can also use set to define your
replaceable parameters by name instead of by number. For
example, if your batch file contains the statement ``type
%file%'', you could use set to set the name that MS-DOS will
use for that variable. In the following command, for
example, set replaces the %file% parameter with the filename
taxes.86:
set file=taxes.86
To change the replaceable parameter names, you don't need to
edit each batch file. Note also that when you use text
(instead of a number) as a replaceable parameter, the name
must be ended by a percent sign.
The set command is especially useful in the autoexec.bat
file, because it lets you automatically set strings or
parameters when you start MS-DOS. See Chapter 4, ``Batch
Processing,'' for more information about the autoexec.bat
file.
Example
The following command sets the string ``include'' to c:\inc
until you change it with another set command:
set include=c:\inc
If you just enter set, MS-DOS displays the current
environment settings.
Notes
set is an internal command.
SET(DOS) (printed 8/16/89) SET(DOS)