在 Windows 上查看进程的环境变量

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2255968/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 13:55:27  来源:igfitidea点击:

View environment variable of process on Windows

windows

提问by theactiveactor

How do I view the environment variable of a Windows process? Looking for Windows equivalent for something like environfile in procfs on Unix.

如何查看Windows进程的环境变量?environ在 Unix 上的 procfs 中寻找类似文件的Windows 等价物。

回答by ziya

Process Exploreror one of its friends should help.

Process Explorer或其朋友之一应该会有所帮助。

回答by John Feminella

回答by John Feminella

Take a look at the _environ variable.

看看_environ 变量

回答by alemjerus

To get process environment, you must be able to obtain its context. And within the context, use getenv()to get specific variable.

要获得流程环境,您必须能够获得其上下文。并在上下文中,用于getenv()获取特定变量。