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 " !)

๐Ÿ’ 

๐Ÿ”ต Best-selling hard drives, USB flash drives & SSDs everyone's buying.

Fast, reliable, and on sale now. Thousands pick these weekly โ€” don't miss Amazon's lowest storage prices.

โšก Top 10 Bestsellers
๐Ÿ† 4.7โ˜…+ Reviews
๐Ÿ“ฆ Prime Shipping
๐Ÿ‘‰ See today's best-selling Data storage on Amazon.com HDD ยท USB Flash Drives ยท SSD ยท External Drives
๐Ÿ›’
โœ… Updated hourly โ€” Amazon real-time ranking ๐Ÿ”ฅ Limited stock deals ๐Ÿ”— Affiliate
โญ Click to see complete best-selling list โญ
Scroll to Top