windows - 如何在不使用 "My Computer"对话框的情况下在 Windows XP 中设置系统环境变量

标签 windows

我正在为各种项目在不同的 Java SDK(1.4.2、1.5.0 和 1.6.0)之间切换。我想在我的 Windows XP 机器上设置 JAVA_HOME 环境变量,而无需经过繁琐的我的电脑 -> 高级 -> [选择系统变量] -> 编辑 -> 确定 -> 确定

是否可以从命令行执行此操作,或者是否有可以执行此操作的实用程序?

(请注意,我指的不是标准批处理文件“SET”命令 - 我想“全局”设置环境变量,而不仅仅是在控制台窗口的生命周期内)。

最佳答案

来自 http://vlaurie.com/computers2/Articles/environment.htm :

Using the add-on tool Setx.exe

It is not part of the standard Windows XP setup but a command-line tool called setx.exe is included in the Windows XP Service Pack 2 Support Tools. This tool extends the set command so that permanent changes in the environment variables can be made. For example, to add a folder C:\New Folder to the path, the command would be setx path "%PATH%;C:\New Folder"

关于windows - 如何在不使用 "My Computer"对话框的情况下在 Windows XP 中设置系统环境变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/331862/

相关文章:

windows - 使用 MinGW 编译 Qt Creator

c++ - 知道 CPU 是否支持纳秒

windows - 批量游戏退出而不是进入下一行

windows - 如何使用 .bat 文件运行以下命令

windows - 按批处理 "CMD"文件为特定系统执行特定作业

windows - Node.js 安装窗口

javascript - 尝试打开本地文件时,IE 8.0 访问被拒绝

java - 批处理脚本 - 此时出现意外错误

windows - 当程序被命令行中的 Edit>Mark 暂停时,究竟发生了什么?

windows - Notepad++ 列模式 : Go To Last Line