64位Windows下如何获取环境变量?
有没有办法在64位机器上检索环境变量。 我已经有 %abc% ,它在 32 位机器中返回变量,但在 64 位机器中不起作用。
我的错误: 如何通过命令行而不是通过编程语言来实现?
Is there any way to retrieve the environment variable in 64 bit machine.
I already have %abc% which returns me variable in 32 bit machine, but doesn't work in 64 bit.
My Mistake:
How can I get through command line not through programming language?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在 PowerShell 中,您将获得环境变量,
这与位无关。
在 cmd 中,您可以获得环境变量,
这也与位数无关,因此如果您能详细说明您到底尝试了什么以及它在哪里失败以及以何种方式失败,那就太好了。
In PowerShell you'll get environment variables with
This is independent of bit-ness.
In
cmd
you can get environment variables withthis is also independent of bit-ness, so it would be nice if you'd elaborate what exactly you tried and where it failed and in what way.
尝试 System.Environment.GetEnvironmentVariable("abc")
Try System.Environment.GetEnvironmentVariable("abc")