registry question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all
I am retrieving the value of the Environment path variable
from registry key
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Sessio
n Manager\Environment

I notice that there is also other keys like
ControlSet001, ControlSet002 etc. What is the difference
between all these?

Is using the CurrentControlSet key the most reliable?
Thanks for all your valuable replies.
 
You shouldn't use the registry. Rather, use the static
GetEnvironmentVariable method on the Environment class.

The ControlSet001, etc, etc keys are for other boot configurations that
are on your system.

Hope this helps.
 
Thanks Nicholas. I need to change the Path variable and
set it to some other value programmatically. There is
no .NET method for that. So, I am modifying the registry
key programmatically. Any other ideas?
-----Original Message-----
You shouldn't use the registry. Rather, use the static
GetEnvironmentVariable method on the Environment class.

The ControlSet001, etc, etc keys are for other boot configurations that
are on your system.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)


Hi all
I am retrieving the value of the Environment path variable
from registry key
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Sessio
n Manager\Environment

I notice that there is also other keys like
ControlSet001, ControlSet002 etc. What is the difference
between all these?

Is using the CurrentControlSet key the most reliable?
Thanks for all your valuable replies.


.
 
In .NET 1.1 and before, you would want to call the
SetEnvironmentVariable API function through the P/Invoke layer.

In .NET 2.0 a static SetEnvironmentVariable method was attached to the
Environment class.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Thanks Nicholas. I need to change the Path variable and
set it to some other value programmatically. There is
no .NET method for that. So, I am modifying the registry
key programmatically. Any other ideas?
-----Original Message-----
You shouldn't use the registry. Rather, use the static
GetEnvironmentVariable method on the Environment class.

The ControlSet001, etc, etc keys are for other boot configurations that
are on your system.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)


Hi all
I am retrieving the value of the Environment path variable
from registry key
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Sessio
n Manager\Environment

I notice that there is also other keys like
ControlSet001, ControlSet002 etc. What is the difference
between all these?

Is using the CurrentControlSet key the most reliable?
Thanks for all your valuable replies.


.
 
Back
Top