set
Displays, sets, or removes cmd.exe environment variables. Windows commands reference
On Windows, DOS 5 sub-commands
Windows
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).
set [<variable>=[<string>]]set [/p] <variable>=[<promptString>]set /a <variable>=<expression>
To set the value TEST^1 for the environment variable named testVar, type
set testVar=TEST^^1IdentifyTrips 1 Sigma rule: mediumPotential Dosfuscation Activity by frack113, Nasreddine Bencherchali (Nextron Systems)
To set the value TEST&1 for the environment variable testVar, type
set testVar=TEST^&1IdentifyTo set an environment variable named include so the string c:\directory is associated with it, type
set include=c:\directoryIdentifyTo 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%
setIdentifyTo display a list of all of the environment variables that begin with the letter p, type
set pIdentifyTo display a list of all of the environment variables on the current device, type
setIdentify<variable>Specifies the environment variable to set or modify.<string>Specifies the string to associate with the specified environment variable./pSets 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./aSets <string> to a numerical expression that is evaluated.<expression>Specifies a numerical expression./?Displays help at the command prompt.Windows
Sets the context, options, verbose mode, and metadata file for shadow copy creation. If used without parameters, set lists all current settings.
setset contextset optionset verboseset metadata
set contextSets the context for shadow copy creation.set metadataSets the name and location of the shadow creation metadata file.set optionSets options for shadow copy creation.set verboseTurns the verbose output mode on or off./?Displays help at the command prompt.Several platforms
Toggle shell options or set the values of positional parameters.
Display the names and values of shell variables
setIdentifyExport newly initialized variables to child processes
set -aIdentifyWrite formatted messages to stderr when jobs finish
set -bIdentifyWrite and edit text in the command-line with vi-like keybindings (e.g. yy)
set -o viIdentifyReturn to default (emacs) mode
set -o emacsIdentifyList all modes
set -oIdentifyExit the shell when (some) command fails
set -eIdentifyReset all shell parameters and assign new ones
set -- argument1 argument2 ...IdentifyWindows
Display or set environment variables for the current instance of CMD.
List all current environment variables
setIdentifySet an environment variable to a specific value
set name=valueIdentifyList environment variables starting with the specified string
set nameIdentifyPrompt the user for a value for the specified variable
set /p name=prompt_stringIdentifyDOS
Set/display environment variables.
Set variable
SET VAR=valueIdentify