Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Environment variable
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Assignment: DOS, OS/2 and Windows === In DOS, OS/2 and Windows command-line interpreters such as <code>COMMAND.COM</code> and <code>CMD.EXE</code>, the '''<code>[[SET (DOS command)|SET]]</code>''' command is used to assign environment variables and values using the following arguments: <syntaxhighlight lang="batch"> SET VARIABLE=value </syntaxhighlight> An environment variable is removed via: <syntaxhighlight lang="batch"> SET VARIABLE= </syntaxhighlight> The '''<code>SET</code>''' command without any arguments displays all environment variables along with their values; '''<code>SET " "</code>''', zero or more spaces, will include internal variables too. In <code>CMD.EXE</code>, it is possible to assign local variables that will not be global using the '''<code>SETLOCAL</code>''' command and '''<code>ENDLOCAL</code>''' to restore the environment. Use the [[switch (command line)|switch]] '''<code>/?</code>''' to display the internal [[man page|documentation]], or use the [[help (command)#DOS|viewer]] '''<code>help</code>''': <syntaxhighlight lang="batch"> SET /? HELP SET SETLOCAL /? HELP SETLOCAL </syntaxhighlight> In [[PowerShell]], the assignment follows a syntax similar to Unix: <syntaxhighlight lang="powershell"> $env:VARIABLE = "VALUE" </syntaxhighlight>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)