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!
=== 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>, an environment variable is retrieved by placing a <code>%</code> sign before and after it. In DOS, OS/2 and Windows command-line interpreters as well as their [[API]], upper or lower case is not distinguished for environment variable names. The environment variable named <code>HOMEDRIVE</code> contains the drive letter (plus its trailing <code>:</code> colon) of the user's home directory, whilst <code>HOMEPATH</code> contains the full path of the user's home directory within that drive. So to see the home drive and path, the user may type this: <syntaxhighlight lang="batch"> ECHO %HOMEDRIVE%%HOMEPATH% </syntaxhighlight> The command '''<code>SET</code>''' (with no arguments) displays all environment variables and their values. In [[Windows NT]] and later <code>set</code> can also be used to print all variables whose name begins with a given prefix by giving the prefix as the sole argument to the command. In [[Windows PowerShell]], the user may type any of the following: <syntaxhighlight lang="powershell"> echo $env:homedrive$env:homepath Write-Output $env:homedrive$env:homepath "$env:homedrive$env:homepath" </syntaxhighlight> In PowerShell, upper or lower case is not distinguished for environment variable names. The following command displays all environment variables and their values: <syntaxhighlight lang="powershell"> Get-ChildItem env: </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)