Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
404 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 Reply

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...