Overview of Windows Heart - The Registry

Tariqul Islam

New Member
Messages
182
Reaction score
0
Points
0
Today I intend to demystify the Windows Registry, basically Windows 98 Registry. It will help you learn how to find the information you need so that you will quickly become an expert in editing the Registry safely and effectively. I like working on the Registry because it's a source of computing power. I no longer feel that I'm at the mercy of Windows, but know that I can take some measure of control into my own two hands and make it work for me.


What is Registry ?

The Registry is the hierarchical, centralized database of information that Windows 98 uses to start up and run applications, determine what device drivers to use to operate Plug and Play and legacy hardware, and set up user profiles and system policies. In short Registry is the heart of Windows Operating System. The Registry is the part of Windows 98 that can turn you from a casual computer user to a power user.


Benefits of Learning The Registry

Learning about the Registry provides a number of benefits:
  • Helps you troubleshoot and provide system support.
  • Enables you to customize and add a new level of functionality to your system.
  • Assists you in supporting Windows 98 systems on NT networks.
  • Allows you to access Registry settings for a program that you are developing for use on Windows 98 or NT computers.
  • Helps you understand how your computer works.
  • Gives you confidence.


Registry's Root Structure

You might think of the Registry as resembling a beehive of activity. Like a hive, the Registry has a well-defined organization, and all members of the hive have a job to do. Registry consists of SIX root members. The members are called the Keys. These root keys contain several sub-keys. The root keys are as follows:

  1. HKEY_CLASSES_ROOT
  2. HKEY_CURRENT_USER
  3. HKEY_LOCAL_MACHINE
  4. HKEY_USERS
  5. HKEY_CURRENT_CONFIG and
  6. HKEY_DYN_DATA
First, always remember that HKEY_LOCAL_MACHINE and HKEY_USERS contain virtually all (perhaps 90 percent) of the Registry data. Also keep in mind that HKEY_CLASSES_ROOT, HKEY_CURRENT_USER, and HKEY_CURRENT_CONFIG are aliases. The sixth key named HKEY_DYN_DATA compiles performance data while your computer is running.


Registry's Root Keys' Functions

  • HKEY_CLASSES_ROOT : This key contains information about OLE, drag-and-drop operations, and shortcuts, and it lets you associate applications with file types. It is also an alias for the HKEY_LOCAL_MACHINE\SOFTWARE\Classes key.
    Abbreviation : HKCR
  • HKEY_CURRENT_USER : This key contains individual settings for the user who is currently logged on to the system. It is an alias for a branch of HKEY_USERS.
    Abbreviation : HKCU
  • HKEY_LOCAL_MACHINE : This key stores hardware and software settings that allow your equipment and programs to run. This key also includes the configuration of Windows.
    Abbreviation : HKLM
  • HKEY_USERS : This key stores the settings related to individual users, and it contains configuration data, such as back-ground colors and desktop layout, wallpaper, and screen savers.
    Abbreviation : HKU
  • HKEY_CURRENT_CONFIG : This key stores information regarding the current hardware profile. If you don't have hardware profiles enabled, this key gives default settings to Windows.
    Abbreviation : HKCC
  • HKEY_DYN_DATA : In contrast to the other keys, which store static data, this key provides pointers to dynamic data that changes constantly as you work on your computer. Windows uses this key to keep track of plug-and-play hardware profiles, performance statistics, and data related to virtual device drivers.
    Abbreviation : HKDD

Registry's Data Storage Mechanism and Data Types

Registry uses Name-Value pairs to store its data. The data has a name and an actual value. So if we want to access a particular data, we have to know the name associated with it.

Registry uses three types of values that are associated with a key: String, Binary & DWORD.

  • String values : (Sometimes called Text Values) consist of text that is enclosed in quotation marks in the form "This is a text value". An empty text value appears as "".
  • Binary values : These are numeric values presented in a sequence of Hexadecimal bytes, such as 00 08 10 21. A defined Binary value must have at least 4 bytes, or 32 bits. An empty entry appears as a zero-length binary value.
  • DWORD values : These are special type of binary value that affects only programming code. While strings are what the user can read, DWORDs are what a program can parse. DWORD values are very long but are presented in a shorthand form called Hexadecimal form. DWORD values are Double WORDs or 8 bytes of information in hexadecimal format. By default, Registry assigns a value of zero, or 0x00000000 (0), to a DWORD entry. A value of one would look like this: 0x00000001 (1).
A value cannot be larger than 64K. So the total size of a subkey cannot exceed 64K.



Registry Communication

Now we have all the primary arms in our hands to start using the Registry. The easiest way to add or modify something to the Registry is to use the REG File. If you want to delete something from the Registry you may use Windows RegEdit tool. Using REG File is not a hard work. Only you have to keep in your mind the following rules for REG Files:

  1. Be absolutely sure to begin your file with the all-important line REGEDIT4 or the Registry won't accept the changes at all.
  2. Also be sure that all key names exactly match those already in your Registry, if you want to replace their values with a REG File. Otherwise, Registry will create a new key instead of replacing the one you want.
  3. Use two backslashes (\\) rather than one (\) in the file's path but not in the Key's path.
  4. Use backslashes as escape keys to surround special symbols, like %.
  5. Use @= to create the Default value of a key.
  6. Remember to enclose the Name of the value in the quotation marks.
  7. String values are always enclosed in quotation marks.
  8. Binary values are always started by hex: and use the , (comma) among the values as this: hex:00,00,00,00
  9. DWORD values are started by dword: and followed by hexadecimal number as this: dword:00000000
  10. Keys are always enclosed in brackets [ ].

Now let us look at an example to deeply understand about the REG Files. In this example we are going to turn off the Documents Menu. Here is the REG File Code that will do the job for us:
Code:
REGEDIT4

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer]
"NoRecentDocsHistory"=hex:01,00,00,00
  1. Create a file named DocsOff.reg using your favorite editor.
  2. Copy the above code to this file.
  3. Save the file and Exit the editor.
  4. Double Click on the newly created DocsOff.reg file.
  5. Click on Yes then on OK.
  6. Restart your Computer.
WOW !!! your Documents Menu is gone.


Explanation of the Example

As you should know already that HKEY_CURRENT_USER root key holds the individual settings of the currently logged user, so the command to turn off this user's Document Menu should be placed here under the appropriate subkey. This is HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer subkey. We have to state first the related subkey in brackets and then the Name-Value pair. As you can see here NoRecentDocsHistory is a Name and 01 00 00 00 is the binary type value. If NoRecentDocsHistory is already exists then our REG File simply replaces the value otherwise creates a new with this value.


Another helpful example for you. In this example we are going to Add our Own Tips in Windows Tips Collection. For this purpose we need the following subkey:

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer\Tips

By default Windows maintains 50 Tips. Each Tip has a unique Number to identify. The Tip list runs from 0 through 49. So you should start your own tip from Tip Number 50 if you do not want to replace the Windows Tips. The data type of the tip is obviously text as you can understand I think. Now the Code of the REG File for you:
Code:
REGEDIT4

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer\Tips]
"50"="This Tip is Added by using Registry"
"51"="Learning Registry is very helpful for all kind of Computer Users"
"52"="Reminder: The staff meeting has been moved to 11:00 A.M. Friday."
Info about the Registry on the Net


Causion

Please be very careful when you work with the Registry or you may harm yourself as the Registry is the Heart of Windows.


Thank you all. Have a nice time. Hope to meet you again in another article. If you want to discuss on something of this Article, please feel free to ask me here.
 

hamsn

New Member
Messages
290
Reaction score
0
Points
0
oh my God!
explained wonderfully
atleast if i am a noob i can understand the basic structure and components
very very helpful post
added reputation!
good, keep it up!
 

Tariqul Islam

New Member
Messages
182
Reaction score
0
Points
0
Thanks Hamsn. Your comment gives me very much courage. I'll give more tutorial soon.
 

mattura

Member
Messages
570
Reaction score
2
Points
18
Nice one.
Now we just need a continuance - 'useful edits you can make to your registry' like the size of the documents menu etc and those niggly things there just isn't a button for!

Definitely BACK UP your registry before meddling with it (Export the root into a file). Also probably worth setting a system restore point, should make it easier if things go wrong.
 

Tariqul Islam

New Member
Messages
182
Reaction score
0
Points
0
Thanks mattura for your comment. I'll add the requested tutorial as soon as I can.
 

Sohail

Active Member
Messages
3,055
Reaction score
0
Points
36
Really good tutorial, by the way "causion" is spelt, "caution".
 
Top