Command: set (command.com command)
SET displays, sets, or removes environment variables.
SET is a BATCH-FILE / AUTOEXEC.BAT command.
It can also be used in command line.
Syntax:
SET [/C] [/P] [/E] [/U] [variable[=[string]]]
SET [/?]
variable Specifies the environment-variable name.
string Specifies a series of characters to assign to the
variable.
If no string is specified, the variable is removed from the
environment.
Type SET without parameters to display the current environment
variables.
Type SET VAR to display the value of VAR.
Options:
/C Forces to keep the case of the variable; by default the variable
is uppercased, if it is not located in the environment already,
otherwise the case is retained (only works for new variables).
/P Prompt the user with string, and assigns the user input to the
variable.
/E Sets the given variable to the first line of output of the
command pointed to by [string].
/U Changes the case of [string] to uppercase.
/? Shows the help.
Comments:
SET can also be used outside a batch file. SET is a command internal to
command.com and needs no other file in order to work.
There also exists a CONFIG.SYS SET command.
Examples:
IN A .BAT FILE / AUTOEXEC.BAT:
set displays a list of the current environment variables
set DRIVE=Z sets the environment variable DRIVE to the given
value Z
set DRIVE= removes the variable DRIVE from the environment
See also:
autoexec.bat
batch files
config.sys
set (config.sys command)
------------------------------------------------------------------------------
Copyright (C) 2003 Robert Platt, updated 2007 by W. Spiegl.
This file is derived from the FreeDOS Spec Command HOWTO.
See the file H2Cpying for copying conditions.