List all environment variables from command line?
I'd like to know if it's possible to list ALL environment variables from Windows' Command Prompt.
Something equivalent to PowerShell's gci env:
(or ls env:
or dir env:
).
Just do:
SET
You can also do SET prefix
to see all variables with names starting with prefix
.
For example if you want to read only derbydb from the environment variables, do the following:
set derby
...and you will get the following:
DERBY_HOME=c:Usersamro-aDesktopdb-derby-10.10.1.1-bindb-derby-10.10.1.1-bin
Jon has the right answer, but to elaborate a little more with some syntactic sugar..
SET | more
enables you to see the variables one page at a time, rather than the whole lot, or
SET > output.txt
sends the output to a file output.txt which you can open in notepad or whatever...
Simply run set
from cmd
.
Displays, sets, or removes environment variables. Used without parameters, set displays the current environment settings.
链接地址: http://www.djcxy.com/p/25578.html上一篇: 在bash中做什么&>?
下一篇: 列出来自命令行的所有环境变量?