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

Categories

0 votes
400 views
in Technique[技术] by (71.8m points)

windows - 从命令行列出所有环境变量?(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.

(我想知道是否可以从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

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

1 Answer

0 votes
by (71.8m points)

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...