A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/set_1 below:

set | Microsoft Learn

Displays, sets, or removes cmd.exe environment variables. If used without parameters, set displays the current environment variable settings.

Note

This command requires command extensions, which are enabled by default.

The set command can also run from the Windows Recovery Console, using different parameters. For more information, see Windows Recovery Environment (WinRE).

Syntax
set [<variable>=[<string>]]
set [/p] <variable>=[<promptString>]
set /a <variable>=<expression>
Parameters Parameter Description <variable> Specifies the environment variable to set or modify. <string> Specifies the string to associate with the specified environment variable. /p Sets the value of <variable> to a line of input entered by the user. <promptstring> Specifies a message to prompt the user for input. This parameter must be used with the /p parameter. /a Sets <string> to a numerical expression that is evaluated. <expression> Specifies a numerical expression. /? Displays help at the command prompt. Examples

To set the value TEST^1 for the environment variable named testVar, type:

set testVar=TEST^^1

The set command assigns everything that follows the equal sign (=) to the value of the variable. Therefore, if you type set testVar=TEST^1, you'll get the following result, testVar=TEST1.

To set the value TEST&1 for the environment variable testVar, type:

set testVar=TEST^&1

To set an environment variable named include so the string c:\directory is associated with it, type:

set include=c:\directory

You can then use the string c:\directory in batch files by enclosing the name include with percent signs (%). For example, you can use dir %include% in a batch file to display the contents of the directory associated with the include environment variable. After this command is processed, the string c:\directory replaces %include%.

To use the set command in a batch program to add a new directory to the path environment variable, type:

@echo off
rem ADDPATH.BAT adds a new directory
rem to the path environment variable.
set path=%1;%path%
set

To display a list of all of the environment variables that begin with the letter p, type:

set p

To display a list of all of the environment variables on the current device, type:

set

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4