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

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!
 
E

Eric Bursley

have you tried setting the environment variable within Windows settings?
System Properties, advanced tab, environment variables
 
Z

Zaphod Beeblebrox

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.
 
B

+Bob+

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top