Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I'd like to know if it's possible to list ALL environment variables from Windows' Command Prompt.

(我想知道是否可以从Windows的命令提示符列出所有环境变量。)

Something equivalent to PowerShell's gci env: (or ls env: or dir env: ).

(相当于PowerShell的gci env:东西gci env:ls env:dir env: 。)

  ask by Nicola Cossu translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
407 views
Welcome To Ask or Share your Answers For Others

1 Answer

Just do:

(做就是了:)

SET

You can also do SET prefix to see all variables with names starting with prefix .

(您还可以执行SET prefix以查看名称以prefix开头的所有变量。)

For example if you want to read only derbydb from the environment variables, do the following:

(例如,如果您只想从环境变量中读取derbydb,请执行以下操作:)

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...