Hi
I need a way to set a persistent user environment variable from VBScript (login script). After doing some research it looks to me like the best way is to write a value to the registry ("HKCU\Environment").
When using the RegWrite function I can write the key and then the variable appears in the list of user variables (My Computer-->Properties-->Advanced-->Environment Variables). So far so good..
However when I go to a command prompt and type "echo %myvariable%", the actual value is not returned. So it looks like the variable exists but is not loaded in memory. After logging off and on again, the echo works fine.
Does anyone know how I can load the persistent variable into memory as soon as the registry key is created? (Some sort of refresh function for variables)?
Cheers,
Tim
I need a way to set a persistent user environment variable from VBScript (login script). After doing some research it looks to me like the best way is to write a value to the registry ("HKCU\Environment").
When using the RegWrite function I can write the key and then the variable appears in the list of user variables (My Computer-->Properties-->Advanced-->Environment Variables). So far so good..
However when I go to a command prompt and type "echo %myvariable%", the actual value is not returned. So it looks like the variable exists but is not loaded in memory. After logging off and on again, the echo works fine.
Does anyone know how I can load the persistent variable into memory as soon as the registry key is created? (Some sort of refresh function for variables)?
Cheers,
Tim