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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing any registry value 2

Status
Not open for further replies.

Tristoff

Technical User
Jun 24, 2000
3
US
Can somebody point me in the right direction?<br>How can I use VB6 to change, add or delete registry keys? I am using a rather clumsy method that involves writing to a registry script linked to my application with OLE.<br>The current solution is temporary and, in my view, untrustworthy. There must be way to do this directly in VB or with the API.<br>Does anybody have any information or can point me to a good web-site?<br><br>Thanks in advance.
 
In VB6 you can do registry mainuplation through GetSetting and SaveSetting registry function. For more detail see MSDN help for these functions.
 
GetSetting doesn't work very well in this instance. Let's say I want to retrieve the value of "username" from LOCAL_MACHINE\Network\Logon.<br>The GetSetting syntax is GetSetting(appname, section, key[, default]). Do I set "appname" to "Windows"? Windows doesn't know of an appname called Windows.<br>Retrieving the username is just an example (I know an API function that returns the same). The question is how do I manipulate the registry without using the ungainly method I described in my original posting?
 
I have emailed Tristoff about her comment on a FAQ about WritePrivateProfile string, here is the email:<br><br><FONT FACE=monospace><br>Many thanks, Karl. Your reply may also answer my Tek-Tips VB6 question about<br>changing registry values. I will try it out!<br><br>Regards,<br>Tristan<br></font><br><br>I mentioned the Write Profilestring, was for the Ini files, the getting DSN from Odbc FAQ , can be modified(just change the paths) to retreive any entry in the registry anywhere, not just from your own application settings. <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>Experienced in , or have messed with : VC++, Borland C++ Builder, VJ++6(starting),VB-Dos, VB1 thru VB6, Delphi 3 pro, Borland C++ 3(DOS), Borland C++ 4.5, HTML,Visual InterDev 6, ASP(WebProgramming), QBasic(least i didnt start with COBOL)
 
Have a look at the FAQ &quot;Reading and Writing Registry Values&quot; in the API section. Module there should be what you need. <p>Mike<br><a href=mailto:michael.j.lacey@ntlworld.com>michael.j.lacey@ntlworld.com</a><br><a href= Cargill's Corporate Web Site</a><br>
 
Mike, that FAQ was just what the doctor ordered! And thanks again, Karl, portions of your FAQ will be very usefull. <p> <br><a href=mailto:Tristoff@Excite.com>Tristoff@Excite.com</a><br><a href= > </a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top