PDA

View Full Version : Windows system variable



George_Ar
01-02-2002, 08:59 AM
Hi,

How can i set my own windows system variable, such as PATH or Os2LibPath in WinNT, so that after installation my variable would stay in system environment space.

My installation searches for Java Development Kit on a target machine. If entry in registries is found, it finds path to the JDK. I need to create system variable JDK_HOME with path i got from registry. And i need to have this variable permanent, even after user reboots PC.

Thanx, George

Andy M-S
01-02-2002, 10:21 AM
On NT and its descendents (W2K and XP) the path information is stored in the registry, at:

HKJLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment

You can set PATH or other variables within this key. BUT!!!! Be certain to turn off logging when you write to an item in this key, or on uninstall, you might, say, wipe out the entire PATH...

George_Ar
01-02-2002, 11:42 AM
Thanx, it works now !