在 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
View environment variable of process on Windows
提问by theactiveactor
How do I view the environment variable of a Windows process? Looking for Windows equivalent for something like environ
file in procfs on Unix.
如何查看Windows进程的环境变量?environ
在 Unix 上的 procfs 中寻找类似文件的Windows 等价物。
回答by ziya
Process Exploreror one of its friends should help.
Process Explorer或其朋友之一应该会有所帮助。
回答by John Feminella
Check out GetEnvironmentStrings
.
回答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()
获取特定变量。