RE: SetEnvironmentVariable in Debug and Release cofiguratin
- From: "billr" <billr@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 16 Aug 2005 02:58:40 -0700
>From the Platform SDK
--------------------------
Calling SetEnvironmentVariable has no effect on the system environment
variables. The user can add or modify system environment variables using the
Control Panel. To programmatically add or modify system environment
variables, add them to the
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session
Manager\Environment registry key, then broadcast a WM_SETTINGCHANGE message.
This allows applications, such as the shell, to pick up your updates.
So, my next question is this ... how are you checking for your environment
variable, are you doing it programatically (calling GetEnvironmentVariable)
or are you trying to find it in the EnvironmentVariables tab of the control
panel, etc.
You will not be able to see the variable in your system environment
variables (via the control panel) every PROCESS has an environment block that
contains a set of environment variables and their values, you will have to
inspect these environment variables programatically.
I hope that helps.
:o))
--
--
Of all words of tongue and pen, the saddest are: "It might have been"
"denis.greatest@xxxxxxxxx" wrote:
> Hello folks,
>
> I was trying to set some environment variable for a process I create.
> (The variables are my own, not system).
>
> I use SetEnvironmentVaraible() from C# code.
> In Debug configuration this works fine, but in Release configuration
> the action fails.
> The return value is TRUE, and no Exception is thrown.
>
> Any ideas ?!
>
>
.
- Follow-Ups:
- References:
- SetEnvironmentVariable in Debug and Release cofiguratin
- From: denis . greatest
- SetEnvironmentVariable in Debug and Release cofiguratin
- Prev by Date: call stack tracing for Threads in Thread pool
- Next by Date: Re: Possible bug in .NET multicast socket?
- Previous by thread: SetEnvironmentVariable in Debug and Release cofiguratin
- Next by thread: RE: SetEnvironmentVariable in Debug and Release cofiguratin
- Index(es):
Relevant Pages
|