CmdID

CmdID / Commands

set

Displays, sets, or removes cmd.exe environment variables. Windows commands reference

On Windows, DOS 5 sub-commands

Opens CmdID with your command. It is read in your browser and sent nowhere.

Windows

from the Windows commands reference, CC BY 4.0

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^^1Identify

Trips 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^&1Identify

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

set include=c:\directoryIdentify

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% setIdentify

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

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

<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

from the Windows commands reference, CC BY 4.0

Sets the context, options, verbose mode, and metadata file for shadow copy creation. If used without parameters, set lists all current settings.

set
set context
set option
set verbose
set 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

from tldr-pages, CC BY 4.0

Toggle shell options or set the values of positional parameters.

Display the names and values of shell variables

Export newly initialized variables to child processes

set -aIdentify

Write formatted messages to stderr when jobs finish

set -bIdentify

Write and edit text in the command-line with vi-like keybindings (e.g. yy)

set -o viIdentify

Return to default (emacs) mode

set -o emacsIdentify

List all modes

set -oIdentify

Exit the shell when (some) command fails

set -eIdentify

Reset all shell parameters and assign new ones

set -- argument1 argument2 ...Identify

Windows

from tldr-pages, CC BY 4.0

Display or set environment variables for the current instance of CMD.

List all current environment variables

Set an environment variable to a specific value

set name=valueIdentify

List environment variables starting with the specified string

set nameIdentify

Prompt the user for a value for the specified variable

set /p name=prompt_stringIdentify

Set/display environment variables.

Set variable

SET VAR=valueIdentify

Sub-commands

each with its page