Home All Groups Group Topic Archive Search About

can environment variables be globally set via a batch file?

Author
4 Feb 2006 4:56 AM
iidabashiboy@writeme.com
I would like to have a few links on my W2K desktop, that I can
double-click to set the TEMP and TMP environment variables (thus
avoiding the tedius control panel/system/advanced/...).

A simple batch file will not work, since it only changes the variables
within that shell, which immediately exits.  I want the new variables
to take effect globally and stay in effect until I change them.

Is there an easy way to do this?

Author
4 Feb 2006 5:07 AM
Pegasus (MVP)
<iidabashi***@writeme.com> wrote in message
news:1139029010.217044.173750@g47g2000cwa.googlegroups.com...
> I would like to have a few links on my W2K desktop, that I can
> double-click to set the TEMP and TMP environment variables (thus
> avoiding the tedius control panel/system/advanced/...).
>
> A simple batch file will not work, since it only changes the variables
> within that shell, which immediately exits.  I want the new variables
> to take effect globally and stay in effect until I change them.
>
> Is there an easy way to do this?

Yes, there is: Use setx.exe from the Windows 2000 Resource
Kit. Note that any variable you set with setx.exe will be
visible in ***new*** process only, not in pre-existing processes.