Script – Set Permanent Environmental Variable in Windows XP

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?

commandSETX JAVA_HOME=”C:javajdk-1.4″is not supported in my machine. It is Windows XP service pack 3.

Solution:

Per user settings command line:

% reg add KEY  /v JAVA_HOME /t REG_SZ /d "C:javajdk-1.4"

For user only settings replace KEY with:

HKCUEnvironment

For per machine settings replace KEY with:

HKLMSYSTEMCurrentControlSetControlSession ManagerEnvironment

(Attention: there is a space in the last key, quote it with " !)