Set Permanent Environmental Variable in Windows XP
15,979
Per user settings command line:
% reg add KEY /v JAVA_HOME /t REG_SZ /d "C:\java\jdk-1.4"
For user only settings replace KEY with:
HKCU\Environment
For per machine settings replace KEY with:
HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
(Attention: there is a space in the last key, quote it with "
!)
Related videos on Youtube
Author by
The Beast
Updated on September 17, 2022Comments
-
The Beast over 1 year
I want to set environmental variables permanently through a batch file. Is there a command to set Permanent Environmental Variable (other than SETX) for Windows XP service pack 3?
command SETX JAVA_HOME="C:\java\jdk-1.4" is not supported in my machine. It is Windows XP service pack 3.
-
quack quixote about 14 yearsyou mean specifically via command-line? or will a control panel suffice?
-
The Beast about 14 yearsI want to do it through the batch file since it should be done for several machines.
-
Mark Mikofski over 11 yearsYou can also use
SETX
. See this superuser post. -
Jaime Hablutzel over 11 yearsHe said specifically that setx is not an option
-
-
The Beast about 14 yearshey can u tell me where can i find similar commands like this one.
-
akira about 14 yearsdefine "similar". modifying the registry? thats not so similar to, lets say, deleting files. best way to find things is to have a problem and to search for an answer here on superuser and, if nothing fits, ask your next question
-
The Beast about 14 yearshey hey thank. Got what i wanted. Good work. Saved the day.Thanks again.
-
Sam over 11 years@shyameniw you told akira suggestion done fine, please say your complete command. thanks
-
akira over 11 years@MJM: the command is the one i posted. right there, 2nd line.