Vista32 上我的环境变量设置在哪里?
通过以下方式:
开始 ->电脑->右键单击->属性->高级系统设置->高级->环境变量
我找到了brianjd的用户变量
(其中包括TMP
和TEMP
)和系统变量
(其中包括路径
、用户名
等)。我希望这些变量在 C:\AUTOEXEC.BAT
或 C:\CONFIG.SYS
中设置。相反,我在这些文件中找到了 NTVDM 的 REM Dummy 文件
和 FILES=40
。
问:实际使用 SET USERNAME=brianjd 等语句设置环境变量的文件在哪里?
问:当我按照上面的 Windows GUI 路径并将变量名称和值 FOO
和 C:\foo
添加到 brianjd 的用户变量
时或系统变量
,到底发生了什么? Windows 将什么内容写入何处?
By following:
Start -> Computer -> Right Click -> Properties -> Advanced System Settings -> Advanced -> Environment Variables
I find User variables for brianjd
(which includes TMP
and TEMP
) and System Variables
(which includes, Path
, USERNAME
, etc.). I would expect these variables to be set in C:\AUTOEXEC.BAT
or C:\CONFIG.SYS
. Instead, I find REM Dummy file for NTVDM
and FILES=40
in those files.
Q: Where are the files that actually set the environment variables with statements like SET USERNAME=brianjd
?
Q: When I follow the Windows GUI path above and add the variable name and value FOO
and C:\foo
to either User variables for brianjd
or System Variables
, what is actually happening? What is Windows writing to where?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
例如,变量不在 Linux 上的 /etc/environment 等脚本文件中。 Windows 将它们存储在注册表中。键是“HKCU\Environment”(用户变量)和“HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment”(系统范围变量)。
另请参阅相关的 MSDN 文章。
The variables are not in a script file like /etc/environment on Linux, for example. Windows stores them in the registry. The keys are "HKCU\Environment" (user variables) and "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" (system-wide variables).
See also the relevant MSDN article.