Name

set

Synopsis

The set command manipulates environment variables from the command line.

Type set without options to display all the current environment variables, or use this syntax:

set [variable[=[string]]]
set /p variable=[promptstring]
set /a expression
               

Type set with only a variable name (no equal sign or value) to display a list of all the variables whose prefix matches the name. The set options are:

Option

Description

variable

Specifies the variable name. If variable is specified by itself, its value is displayed. If variable is specified by itself with an equals sign, the variable is assigned an empty value and deleted. variable cannot contain spaces.

string

Specifies a series of characters to assign to variable. This can contain references to other variables by surrounding them with preceding and trailing percent signs (%).

/p

Specifies that variable will be assigned by text input from the user, rather than string.

promptstring

The text prompt to display when using the /p option.

/a

Specifies that expression is a numerical expression to be evaluated.

expression

When used with the /a option, expression ...

Get Windows XP Pocket Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.