Windows 95 registry


 

 

 

 

 

DOS and Windows 3.x

Early PC`s, before the advent of Windows, used only MS DOS as the operating system.

MS DOS used a number of files to hold the data about how the PC should be configured.

These include

  • autoexec.bat

  • config.sys

  • command.com

  • msdos.sys

  • io.sys

When Windows came along, it was neccessary to add more files, for the information about the configuration of Windows itself.

Windows 3.x versions therefore added the following files to the above list :-

  • system.ini

  • win.ini

  • control.ini

  • progman.ini

It was neccessary to retain all the DOS configuration files for two reasons :-

  1. Windows 3.x sat above DOS, and used it as an interface between Windows and the BIOS.

  2. To ensure that Windows based PC`s kept backward compatibility with earlier DOS based applications.

In addition to all these .ini files, each Windows based application added its own .ini files, so it was quite possible to have 50 to 100 .ini files on a PC.

 

Windows 95

Windows 95 adds even more files for its configuration :-

  • user.dat - which stores information about every individual user

  • system.dat - which stores information about the specific PC

Windows 95 also stores part of its configuration data in RAM every time it is run.

Note that these are in addition to all the previous DOS and Windows 3.x files - this is to ensure backward compatibility with previous generations of applications.

The five DOS files are located in the C drive root directory.

The four Windows 3.x files, and the two new Windows 95 files are located in the Windows directory.

 

The registry

The above two files, user.dat and system.dat, and the use of RAM, are the the method by which Windows 95 physically stores the configuration database within itself.

In contrast, the registry is the name given to the logical construction of the configuration database within Windows 95.

The registry is divided up into 3 sections - these can be thought as 3 logical directories, but are actually called "keys".

These three sections are headed by three primary keys, which are called :-

  • HKEY_LOCAL_MACHINE

  • HKEY_USERS

  • HKEY_DYN_DATA

These primary keys correspond to the files and RAM storage shown above :-

  • User information - HKEY_USERS - stored in the user.dat file

  • System information - HKEY_LOCAL_MACHINE - stored in system.dat

  • Dynamic status information about hardware devices - HKEY_DYN_DATA - stored in RAM, or sometimes main memory, and is recreated every time Windows 95 is run

All these primary keys contain several subkeys, each of which in turn holds either a number of entries ( or "fields" in database terminology ), or else a further layer of subkeys, each holding a number of entries, or again, yet another layer of subkeys and more entries.

This structure corresponds to a typical mainfolder / sub-folder / files type of tree structure which exists on any hard drive, and can be seen with Windows Explorer or Windows File manager - but in the case of the registry, the directories or folders, and the files do not exist as such, the whole thing is a logical representation of a physical database.

The entries or fields have what the registry calls values, and these values can take a number of forms :-

  • binary value - ie, a series of "0"s and "1"s of any length up to a maximum value of 64K. Usually shown in hexadecimal form.

  • dword - a particular kind of binary value that always has 4 bytes. Again, usually shown in hexadecimal form, with 8 characters ( two hexadecimal characters per byte ).

  • text string - this could be a name, or a path ( eg - C:\windows\wordpad.exe ). It can contain numbers, but these numbers are a means of identification, not a quantity.

  • special types - whereas the above three are standard Windows 95 registry value types, the registry also allows programmers to introduce special types of value as part of the interaction between applications and Windows 95.

 

Now it gets more complicated

When the registry was created, three more primary keys were introduced - but instead of them heading up three more sections, they are actually subsets of two of the existing primary keys.

  • HKEY_CURRENT_USER is the first of these, and is a subset of HKEY_USERS.

    HKEY_USERS holds all the individual set up information for all registered users - each user can customise various parts of Windows 95 and the applications, and all these customisations are stored against the user`s name in HKEY_USER.

    When a user logs on, HKEY_CURRENT_USER extracts that users data from HKEY_USER, and sets up its own mini database, and this information is used to set up Windows 95.

  • HKEY_CLASSES_ROOT is the next one, and this mirrors the sub-key HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES.

    It contains information on OLE ( object linking and embedding ) and registered file types.

    HKEY_CLASSES_ROOT has a historical background, as it is a continuation of the registry that was a virtually unknown part of WINDOWS 3.x versions.

    It is therefore one of the methods that Windows 95 uses to ensure compatibility with applications that were written for Windows 3.x.

  • HKEY_CURRENT_CONFIG is the third one, and it mirrors HKEY_LOCAL_MACHINE\CONFIG.

    It holds information about Plug and Play, and about the present configuration of the PC - Windows 95 allows the PC to be configured in different ways, depending on how the PC is being used at the time.

    In contrast, HKEY_LOCAL_MACHINE\CONFIG stores information about all the different configurations available to the PC, so HKEY_CURRENT_CONFIG extracts just the relevant currently required configuration data.

The complete list of primary keys in the registry therefore looks like :-

  • HKEY_LOCAL_MACHINE

  • HKEY_CLASSES_ROOT

  • HKEY_CURRENT_CONFIG

  • HKEY_USERS

  • HKEY_CURRENT_USER

  • HKEY_DYN_DATA

 

Modifying the registry

There are several ways to modify the registry, but by far the easiest and safest way is to use the normal menu commands that Windows 95 provides, in order to allow customisation.

So for example, by following the path via menu commands

My computer/control panel/display/background/wallpaper/browse

and selecting a file as wallpaper, the corresponding registry entry

HKEY_USERS\DEFAULT\CONTROL PANEL\DESKTOP\wallpaper

is modified and puts in for the value entitled wallpaper a text string which is the path set up as above.

Also, the registry entry

HKEY_CURRENT_USER\CONTROL PANEL\DESKTOP\wallpaper

shows the same value.

Note that if a named user was logged onto the PC, the HKEY_USERS path would show the user`s name instead of DEFAULT.

Some of the values inside the registry cannot be altered using the normal menu driven commands.

These include some access limitations that a system manager can impose on different users.

Windows 95 provides a tool for this purpose, called the System Policy Editor, and it is found in an executable file called poledit.exe.

When Windows 95 is loaded from CD, this file is not installed, but it can be found on the CD in \ADMIN\APPTOOLS\poledit.exe, and then copied into the C:\WINDOWS\ directory.

Alternatively, it can be installed using Control panel/Add-remove.

Another tool that is provided with Windows 95 is called the Registry Editor, and is an executable file called regedit.exe, which is found within the C:\WINDOWS\ directory.

Be warned - this is a powerful and dangerous tool that allows direct modification of every registry value - modify the wrong thing, and instant disaster can occur.

It does, however, present the registry in a two panel display similar to Windows Explorer, with the primary key and sub key structure in the left hand panel, and the actual values listed in the right hand panel.

It is therefore an excellent aid to assist in visualising the registry logical structure.

Finally, there are a number of commercial, shareware, and freeware programs available which also allow various forms of registry modification.

 


© 1998 Ron Turner


Return to the index page