Vista UAC pops up a new Command window and my environment variable islost

  • Thread starter Thread starter Bo
  • Start date Start date
B

Bo

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!
 
have you tried setting the environment variable within Windows settings?
System Properties, advanced tab, environment variables
 
Bo said:
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.
 
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!

You could put it in a system startup file so that it is defined all
the time.
 
Back
Top