Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Registry manipulation

Status
Not open for further replies.

VB400

Programmer
Sep 8, 1999
359
US
I'm trying to retrieve a value from the registry. Some values within the same key allow me to view them while others abort the program with an &quot;Access Violation&quot; error. <br>
<br>
Oddly enough, I can manually change the entry to which I was programatically denied access (using regedit).<br>
<br>
The key I'm trying to retrieve is:<br>
<br>
&quot;HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Tcpip\Parameters&quot;<br>
the actual value I want is &quot;NameServer&quot;<br>
<br>
Can anyone shed some light on this?<br>

 
Is there some reason why you're querying ControlSet001, and not CurrentControlSet? The latter should show the values for the current configuration, and not a configuration the machine may or may not be in.<br>
<br>
Other than that, there shouldn't be any problems with doing your typical RegQueryValueEx(). If you were trying to change it, I can see having to have Administrator authority.<br>
<br>
Chip H.<br>

 
One other thought I had as I was debugging something like this for a client... If DHCP is enabled, then when the system logs into the domain, NT may be setting this information automatically based on the DHCP settings on the PDC it connected to. So even if you do change it, next time the machine logs in, it's possible that it will be reset.<br>
<p>Steve Meier<br><a href=mailto:sdmeier@jcn1.com>sdmeier@jcn1.com</a><br><a href= > </a><br>
 
Thanks Chip and Steve,<br>
<br>
I now understand the difference between ControlSet001 and CurrentControlSet.<br>
<br>
I was able to get the code to work using APIs (really cool); HOWEVER, as Chip mentioned, I was unable to change the value of an entry unless I was logged on as an administrator.<br>
<br>
We basically have a DSL connection and we have a website that we want a group of users to have access to. We normally don't allow that group of users to access the web at all. So my thinking was to (within the VB app) change some registry entry to allow the users to access the web, go to the desired site then change the registry entry again -- this way, they'll have access to the web only when we allow them to do so.<br>
<br>
It works great if we're logged in as Admin but &quot;regular&quot; users don't have the authority to change the registry.<br>
<br>
Any suggestions?<br>
<br>
Tarek
 
Eric,<br>
<br>
Can you expand on that!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top