从命令行列出所有环境变量 [英] List all environment variables from the command line

查看:96
本文介绍了从命令行列出所有环境变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以从Windows的命令提示符中列出所有个环境变量?

Is it possible to list all environment variables from a Windows' command prompt?

等同于PowerShell的gci env:(或ls env:dir env:).

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

推荐答案

只需:

SET

您还可以执行SET prefix来查看名称以prefix开头的所有变量.

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

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

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:\Users\amro-a\Desktop\db-derby-10.10.1.1-bin\db-derby-10.10.1.1-bin

这篇关于从命令行列出所有环境变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆