codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:



Home » Visual Basic » Article

Visual Basic Read and Modify the Registry

Article by: Kenneth Ives (3/29/2003)
Bookmark us now! Add to Favourites
Email a friend!Tell a friend
Sponsored by: FindMyHosting - Web Hosting Search
Summary: Perform the four basic functions to the Windows registry. Add, change, delete, and query. Allows you to to read registry values, and modify both keys and values.
Viewed: 90813 times Rating (477 votes): 
 5 out of 5
 Rate this Article  Read Comments  Post Comments

Visual Basic Read and Modify the Registry



Download Now (6KB)

This project shows you how to perform the four basic functions to the Windows registry. Add, change, delete, and query. It also allows you to to read registry values, and modify both keys and values.




CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums
Rate this article:     Poor Excellent
View highlighted Comments
User Comments on 'Visual Basic Read and Modify the Registry '
Posted by :  Archive Import (Adrian Perez) at 13:10 on Friday, April 25, 2003
I just want to congratulate you Kenneth, I have used many times code like yours, I even have a COM that makes the use of the registry pretty easy... but I have two important functions that I never could find: Access to the performance data in the registry and how to delete keys ... Great Job!!
Posted by :  Archive Import (Scott Devitt) at 23:14 on Friday, May 30, 2003
Very nice, Easy to use and not another
activeX componet to deal with.
Posted by :  Archive Import (REX) at 14:22 on Monday, June 16, 2003
Perfect! I've been looking some time for something like this, it does exactly one of the thing I need for my next project...
Posted by :  Archive Import (tahir fall) at 18:57 on Sunday, June 22, 2003
man, this a real good code, this is just what i was looking for. Thanks keneth, peace out.
Posted by :  Archive Import (Tall Man) at 12:20 on Friday, July 04, 2003
ive gone through 10 codes like this and this is the first one that really works, on the first try to. Thanks Keneth.
Posted by :  Archive Import (Denis Legena) at 10:56 on Tuesday, July 08, 2003
I have to add BINARY key to set default forms used by outlook. Can you help me to do this ? You code can add only Dword and SZ keys.

thx
Posted by :  Archive Import (Alex) at 05:15 on Thursday, July 10, 2003
I perhaps found a little error in the documentation of this nice program:


In function
> regDoes_Key_Exist

there is written: Syntax:
' strKeyQuery = regQuery_A_Key(HKEY_CURRENT_USER, _
' "Software\AAA-Registry Test\Products")

-> shouldnīt it be more like this?

strKeyQuery = regDoes_Key_Exist(HKEY_CURRENT_USER, "Software\AAA-Registry Test\Products")

Sure, if you donīt cut & paste like me you wonīt recognice this;-)

But I have to say this is really a great program;-)

Regards
Alex
Posted by :  Archive Import (melissa) at 16:57 on Monday, July 14, 2003
hola como estas escribeme
Posted by :  Archive Import (Akbar) at 03:35 on Thursday, July 24, 2003
please a readme about comm control in vb and i try to connect some hardware from com1 but not connection thanks as your attention

and please send me mail at home because my home not connection internet
Address Jl.Kutisari selatan xiii no 31
State Indonesia
provence east java
Posted by :  Archive Import (mahmoud ) at 06:34 on Monday, July 28, 2003
i'm a programmer and system analyst
(oracle and vb)
Posted by :  Archive Import (Jan Padmos) at 17:25 on Thursday, July 31, 2003
Very useful code. Thanks Kenneth.
Posted by :  Archive Import (Mike) at 14:44 on Monday, August 11, 2003
I looked all over the place for code that works under Windows 2000, and yours is the only one I found.

Thanks alot, this code is perfect
Posted by :  Archive Import (Dave Wood) at 15:31 on Wednesday, August 13, 2003
At last a routine that actually works and is relatively simple to use. Thanks
Posted by :  Archive Import (sandeep) at 03:23 on Wednesday, August 20, 2003
hi i am vb programmer.but i donot
understand your modify registry
solution.please another solution.
Posted by :  Archive Import (kathir) at 10:30 on Thursday, August 21, 2003
it's really super
but i want to handle the registry settings in remote system
Posted by :  Archive Import (SBW) at 15:23 on Tuesday, August 26, 2003
Add the included module, 'basRegistry,' to your VB project. Read the code in it and follow the comments for instructions on using its functions.
Beautiful, beautiful, beautiful!! Thanks so much for posting this!
Posted by :  Archive Import (Vivienne) at 15:30 on Wednesday, August 27, 2003
Just wondering if the query function actually changes the data in the registry , i.e. does it show that the data is being accessed. I am looking for a forensically sound function that does not alter the data in the registry.
Help most appreciated.
Viv
Posted by :  Archive Import (GazzaLad) at 06:05 on Monday, September 15, 2003
Fantastic! Just what I was looking for for my freeware camera software..
Posted by :  Archive Import (wai) at 05:31 on Tuesday, September 16, 2003
can we access and modify registry by JAVA?? can anyone help me with this??
Posted by :  bomboloni at 03:25 on Thursday, March 18, 2004
Just perfect
Posted by :  darteo at 23:11 on Thursday, April 01, 2004
Hi,

I have tried to run the program in Win95 but the system prompt me saying that MSVBVM60.dll is missing. Do I have to regsvr this dll? Apparently I will not be able to to any regsvr due to security concerns so is there any other way to resolve this?

Thanks. :)
Posted by :  jayshah at 12:44 on Wednesday, June 08, 2005
[b]Please Help[/b]
I your code but i was wondering if there was some way you could put it into a form so when you click a button it makes the entry.

If you can could you PLEASE email it to jayshahuk ["at"] gmail ["dot"] com

Thanks In Advance,


Jay Shah
Posted by :  FunkyDexter at 06:59 on Friday, July 15, 2005
Excellent work and I'm using it. Thanks. I did find a small buglet though, I wanted to save a program version of "6.2" to the registery. The create_key_val routine checks if it's numeric and converts it to a long, which means it loses the decimal place and becomes "6". I got around it by treating all data as strings but I'm sure you'll have a much better solution.

Really though, I dream of having the skill to write something like this.
Posted by :  engineerneeraj at 06:16 on Sunday, August 14, 2005
Hi,
this is really nice code for registry access, however I have little different requirement.
I want to access registry, but I do not have the the Parameter name
e.g. I want to access all the keys Under "\HKLM\Software\Windows"
Any ideas how to impliment that or how can I make use of your existing code?
-Neeraj


To post comments you need to become a member. If you are already a member, please log in .

 



RELATED ARTICLES
Generate License Keys (such as CD keys on Microsoft software)
by Brian Gillham
This class allows you to generate license keys, such as the CD keys on the case of most Microsoft software
Visual Basic Read and Modify the Registry
by Kenneth Ives
Perform the four basic functions to the Windows registry. Add, change, delete, and query. Allows you to to read registry values, and modify both keys and values.
Communicating with the Database (Using ADO)
by Chaudhary Pradeep K. Roy
Using ADO to get connected with the database.
Generate an Array of Unique Random Numbers
by Brian Gillham
This function will generate an ARRAY of TRULY random numbers.
Beginning Resource Files in Visual Basic
by Kenneth Ives
Have you ever wanted to use graphics, such as icons, bitmaps, cursors, and AVI files? How about sound or even message box text? This can be an enormous amount of overhead. These are all examples of more files to keep track of when you distribute an application, DLL, or OCX. Lets find out how resource files can help....
Visual Basic Compact/Repair Access Database Utility
by Kenneth Ives
This utility will compact and repair the access database you select. It is actually more convenient to use this utility than do the same task with Access, because you don't have to save the database with a different name and then delete the old database when you are done: here, a temporary copy of the database is automatically created and deleted.
Creating a watermark in Excel with VBA
by Kenneth Ives
Adding a watermark to an Excel spreadsheet using VBA.
Generate your own Random Numbers
by Thaha Hussain
This simple program generates random numbers using the basic mathematical methods.
Change Cursor to Hour Glass
by Brian Gillham
A simple script to change the cursor to an hour glass.
Analog Clock
by Thaha Hussain
This program demonstrates Thaha Hussain's Clock Work Formula to paint an Analogue Clock.








Recent Forum Threads
• help - sketch
• Re: Perl Script - File Handling.
• Open a file from website
• Re: to open 5 terminals from one and also execute different commands on each terminal
• read a selected multiple line, those should match some of the values read in the files..
• Help me please
• Empty the contents of a file.
• Month Start, End dates
• show hide problem in dynamic table creation


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2008