Re: Change environment for the current console session
- From: Joseph M. Newcomer <newcomer@xxxxxxxxxxxx>
- Date: Mon, 06 Jun 2005 14:45:02 -0400
You can't change the environment for the console. When Microsoft does this, for things
like doing DDK builds, we find there are special batch environments for each kind of
build, which set the environment variables. These are activated by using the /k option,
e.g., the shortcut properties for one of the DKK build commands is:
C:\WINDOWS\SYSTEM32\CMD.EXE /k C:\WINDDK\2600~1.110\bin\setenv.bat C:\WINDDK\2600~1.110
chk
The /k option indicates that the following information is a command line to be run. This
sets the environment variables for that console session. This appears to be the way to
accomplish it when you need it.
joe
On Mon, 6 Jun 2005 12:46:07 -0400, "Maximus" <maximus@xxxxxxxxxxxxx> wrote:
>Hi all,
>
>I need to set the environment variables for the current console session in a
>console program I am working on. The environment variables should be set for
>the current console session. I tried SetEnvironmentVairables and putenv
>functions but they only set the variables for the current process, not the
>console. How to do it. Thanks in advance.
>
Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.
- Prev by Date: Re: MultiThreaded CSockets
- Next by Date: Re: replace system menu with another
- Previous by thread: replace system menu with another
- Next by thread: a new drawing not erase previous drawing?
- Index(es):
Relevant Pages
|