"Joe Cletcher" <Oak Ridge National Laboratory> wrote in message
news:539A766D-9D79-40B3-9E35-(E-Mail Removed)...
>I tried to write a batch job that added an environment variable. However,
>the
> environment variable only persists for the open "command window" that ran
> the
> batch job.
>
> How can I automate the addition of an environment variable?
Every process you start inherits its variables from its
parent. Parents never inherit variables from their child
processes.
To set a variable permanently, you must set it in the
master environment. There are three ways to do this:
a) In the Control Panel / System / Advanced
b) With setx.exe (Windows Resource Kit)
c) With setenv.exe (
ftp://barnyard.syr.edu/pub/vefatica/setenv.exe)
Note that in all cases, the variables in pre-existing processes
are NOT affected. Only processes launched after the change
will get the new variables.