cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
anom217
Level 8

Setting environment variable using registry

I have an InstallScript function that sets an environment variable by creating a value in the registry under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment. The variable shows up when I view the env var GUI under Control Panel, but if I type SET in the command window it isn't listed. If I try to echo it in the command window, it doesn't get any value.

How do I set the environment variable correctly from a script?

This isn't a specifically InstallShield related question, but I was wondering if other people had run into this issue when setting an environment variable through editing the registry.
Labels (1)
0 Kudos
(2) Replies
rguggisberg
Level 13

After "adding a value" (need both Name and Data) you need to reboot. Then it will be there.
0 Kudos
anom217
Level 8

okay. I've been researching still and I found you can use SendMessage() to update all applications of the change in the registry, so you don't have to restart 🙂
0 Kudos