473,386 Members | 2,050 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

registry question

Hi all
I am retrieving the value of the Environment path variable
from registry key
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Contro l\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.

Nov 16 '05 #1
3 1203
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]
- mv*@spam.guard.caspershouse.com
<an*******@discussions.microsoft.com> wrote in message
news:50****************************@phx.gbl...
Hi all
I am retrieving the value of the Environment path variable
from registry key
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Contro l\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.

Nov 16 '05 #2
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 staticGetEnvironmentVariable method on the Environment class.

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

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
<an*******@discussions.microsoft.com> wrote in message
news:50****************************@phx.gbl...
Hi all
I am retrieving the value of the Environment path variable from registry key
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Contro l\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.

.

Nov 16 '05 #3
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]
- mv*@spam.guard.caspershouse.com

<an*******@discussions.microsoft.com> wrote in message
news:49****************************@phx.gbl...
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]
- mv*@spam.guard.caspershouse.com
<an*******@discussions.microsoft.com> wrote in message
news:50****************************@phx.gbl...
Hi all
I am retrieving the value of the Environment path variable from registry key
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Contro l\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.

.

Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Swami | last post by:
I was wondering how I can programmatically find out the path of an installed program. I have an application that needs access to a config file that resides in the folder of another application. ...
3
by: Danny | last post by:
Hi I just have a quick question. One of our Windows based application uses the registry for configuration type options and some other things. I want to modify our application to move to use a...
2
by: Abby | last post by:
I'm sorry that I post this question in this newsgroup, but I don't know where is the right place to post. I have a question if I can get to CPU's registry to modify its clock cycle so that I can...
8
by: Saradhi | last post by:
Can any one put me a piece of code to write binary data into Registry?
2
by: Daniel Bass | last post by:
I've found this article on how to get ASP.Net to read/write from the server's registry, but it got heavily critted as being something that you should not do... ...
6
by: Gary | last post by:
Hi, I have a value stored in the registry "10." and when I extract the stored value and print it in a text form I only get a figure of "10" and not "10." why is this so? and how do I get my...
4
by: Bob | last post by:
My question about how to add an assembly search path to VS.NET's IDE remains unanswered, but I'm still faced with a problem possibly associated with this: my exported registry is more than 67MB....
9
by: nbs.tag | last post by:
hey guys heres my question. I was told by a little birdie that .net 2.0 has the ability to read a connection string directly from a registry key. so in the registry key a string value of say :...
20
by: Newbie Coder | last post by:
MFC Application VC++.NET 2003 I have a certain registry key (HKCU\Software\MyKey) that contains between 30 & 64 string values I need to write a '*' to all those 30 - 64 string values under...
3
by: thephatp | last post by:
BLUF: I need to build up the actual %TEMP% path for all users methodically using values in the registry, and I need to do this both by the current user AND as a service will do this running as...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.