in reply to User Keys - Environment Variables

When you assign a value to an environment variable using %ENV, the value is effective only for that session. After the program that sets the variable terminates, the value is no longer available. To create a persistent environment variable, you must set the value in the Registry . One way to do that is uses a program in the Windows resource kit.

Use the Setx resource kit utility. Setx is a powerful tool with which you can manage the environment variables in NT. This utility has three modes of operation: command line, Registry, and file. The command-line and Registry modes are the most common.

setx LOCATION DALLAS -m

The other option is to hack the registry .

The HKEY_LOCAL_MACHINE\SYSTEM\ CurrentControlSet\Control\ Session Manager\ Environment Registry key stores static system variables.

"We are enthusiastically pro-laugh, we are pro-choice as well. We respect each and every individual’s right not to laugh. If you want to be miserable, go right ahead. Whatever makes you happy."

Replies are listed 'Best First'.
Re: Re: User Keys - Environment Variables
by Anonymous Monk on Dec 16, 2003 at 19:36 UTC
    Thank you, this seems do what I require.
    xxpiper