"Bo" <> wrote in message
news:d5e0f32b-1feb-4e45-84d3-...
> Vista UAC pops up a new Command window and my environment variable is
> lost. The following is my test log:
> ---------- test log ---
> C:\>Set MYENVIRONMENT=1
> C:\>xxx.exe (Run as administrator for UAC)
> it will pop up a new Command window to run it and my previous
> envrionment variable "MYENVIRONMENT" is lost in the new Command
> window.
> --------------------------
>
> Is there any way to get my previous envrionment variable
> "MYENVIRONMENT" in the new pop up Command window?
>
> Any suggestion/comment are appreciated and welcome! Thank you!
Run CMD.EXE as administrator, then set the environment variable and run
your exe. You could also set the environment variable globally through
Windows (System properties, advanced, environment variables) but that
makes it harder to set on the fly, which it appears might be what you
want to do.
--
Zaphod
No matter where you go, there you are!
|