O'Reilly logo

Windows XP Pocket Reference by David A. Karp

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required