The Windows 9x/NT/2000/Millennium

Registry

The Registry

Registry Structure

Registry Editing Rules

Registry backup + restore


The Registry

The Windows 9x/NT/2000/Millennium System Registry is a complex, unified,system wide, continually referenced during operation database for storing system, software and user configuration data, following a hierarchical structure. Its role is to replace the text/ASCII based MS-DOS configuration and MS Windows initialization (.INI) files, used by the old MS-DOS 3/4/5/6.xx, MS Windows 3.xx and MS Windows for WorkGroups 3.1x releases. Most data from the MS-DOS configuration files: AUTOEXEC.BAT and CONFIG.SYS, and all data from the system initialization files: CONTROL.INI, SYSTEM.INI, WIN.INI etc, is now contained into the Registry, together with most of the other system settings. Most Windows 98/95 specific programs (Win32/32-bit applications) store their initialization data into the Registry instead of into .INI files. The MS-DOS and .INI files are kept only for backward compatibility with older MS-DOS and Win16/16-bit based applications. The Windows 95/98 Registry database (stored in binary executable format) is contained in these 2 files: SYSTEM.DAT and USER.DAT, and their automatically created backups from the last successful Windows 95/OSR1/OSR2 startup: SYSTEM.DA0 and USER.DA0, all located in your Windows folder. For write-protection purposes, these 4 files have the following attributes: Hidden, Read-only, System. SYSTEM.DA0 and USER.DA0 are found only on Windows 95, OSR1 and OSR2 systems. Windows 98 and 98 SE back up the Registry automatically upon loading into compressed .CAB files (Microsoft proprietary compression technology), found in the C:\Windows\Sysbckup subfolder (default), and holding 5 (maximum 99) different backup copies (default), a new one being created upon the first Windows 98 boot of each new day (the oldest is replaced with the newest). They are named from RB000.CAB, RB001.CAB, ... up to RB099.CAB. Windows 98's automatic Registry backup is enabled by this command: C:\Windows\Scanregw.exe /autorun found as a String value called "ScanRegistry" under this Registry key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run

[BACK TO TOP]

 

Registry Structure

The Registry consists of 2 basic components:

- (sub)key: storage container (folder, directory, tree, heading). They organize the Registry data in a consistent and hierarchical format. Keys can contain subkeys and values. Each (sub)key's name is predefined by the system or created by users or programs, and can contain spaces and most alphanumeric characters. A (sub)key is defined by its complete pathway starting at the root level (main key): HKEY = Hive Key.

- value: stores actual Registry data used by the system to control hardware and software settings. Values (like files) are stored inside (sub)keys. Value names define data type and are displayed in multiple alphanumeric formats.

There are 4 basic Registry value types:

- REG_BINARY (Binary Value): in 2 numeric formats: binary (base of 2) or hexadecimal (base of 16).

- REG_DWORD (DWORD Value): in 3 numeric formats: decimal (base of 10), hexadecimal (base of 16) or binary (base of 2).

- REG_SZ (String Value): in 2 text formats: text (ASCII) or expandable string (see below).

- REG_EXPAND_SZ (Expandable String Value): in system variable (%string%) format, accessed by substituting variables with actual system path names. When you run the Registry Editor (Regedit.exe) located in your Windows 98/95 folder, you'll see the following expandable Registry subtrees, each marked with a plus [+] sign, under the "My Computer" heading (main tree). To further expand each subtree and view all underlying branches (subkeys), click on the plus [+] signs of the 6 main keys(hives) below.

Key/tree/heading and subkey/subtree/subheading are used here as synonyms:

[+] My Computer

|

|-[+] HKEY_CLASSES_ROOT (HKCR): Software settings: DDE, OLE, drag-and-drop, Win31 backward compatibility, shortcut settings and subkeys for every defined file association, also found at

|

| HKEY_LOCAL_MACHINE\SOFTWARE\Classes.

|

|-[+] HKEY_CURRENT_USER (HKCU): Currently logged on user configuration settings, also found at HKEY_USERS. Subkeys:

| |

| |-[+] AppEvents: Assigned system and applications sound events settings.

| |

| |-[+] Control Panel: Control Panel settings, similar to those defined in System.ini, Win.ini and Control.ini in Windows/WfWG 3.xx.

| |

| |-[+] InstallLocationsMRU (Most Recently Used): Installation and Startup folders paths.

| |

| |-[+] Keyboard: Current keyboard layout.

| |

| |-[+] Network: Network connection settings.

| |

| |-[+] RemoteAccess: Current log on location settings, if using Dial-Up Networking (DUN).

| |

| *-[+] Software: Software configuration settings for the currently logged on user, sorted by vendor/developer.

|

|-[+] HKEY_LOCAL_MACHINE (HKLM): User independent hardware and software machine specific information: bus type, device drivers, keyboard layout etc. Subkeys:

| |

| |-[+] Config: System and software configuration.

| |

| |-[+] Enum: Hardware devices information/settings.

| |

| |-[+] Hardware: Serial communication port(s) information/settings.

| |

| |-[+] Network: Information/settings about network(s) the user is currently logged on to.

| |

| |-[+] Security: Network security information/settings.

| |

| |-[+] SOFTWARE: Software specific information/settings sorted by developer/vendor.

| |

| *-[+] System: System startup, device driver and operating system information/settings.

|

|-[+] HKEY_USERS (HKU): Information about Desktop and user specific settings for each user who logs on to the same Windows 9x system. Each user has a separate subkey here. If there is only one user, the only subkey here is ".Default".

|

|-[+] HKEY_CURRENT_CONFIG (HKCC): Information about the current hardware profile used by the local computer at startup, pointing to

|

| HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current.

|

*-[+] HKEY_DYN_DATA (HKDD): Virtual key (exists only in memory), created every time Windows 9x initializes: dynamic configuration data about installed Plug-and-Play (PnP) devices. Changes constantly when hardware devices are added, swapped or removed on-the-fly.

[BACK TO TOP]

 

 Registry Editing Rules

To modify the Registry, you need to run the Registry Editor, a program called Regedit.exe, located in your Windows 98/95 folder.You can use either RegEdit's interface in protected mode Windows environment (from within Windows GUI) or REGEDIT's DOS based command line parameters in real mode MS-DOS (from outside Windows). To learn how to use REGEDIT's available DOS mode switches, run:

REGEDIT

only from native MS-DOS. See the "SHRINK THE REGISTRY!" topic in MYTIPS95 for details. If you are NOT familiar/comfortable with "messing around" with your Registry file structure/settings, do NOT attempt to make ANY changes! But let's suppose you ARE familiar enough with your system Registry "innards" and would like to tweak it for MAXimum performance. After all this is THE purpose of this file. :) So keep reading...

* If you don't like to modify your Registry directly, there is an "easier" [:-)] alternative: use one of these Windows 9x system "Power Toys", listed in SOFTWARE (included) under the "FREE WINDOWS 9x/NT POWER TOYS" topic, also online at: http://members.aol.com/axcel216/toy.htm#GUI

My favorites [ALL FREEware]:

- Microsoft TweakUI 98: use with caution (BACKUP FIRST!): READ the "BUGGY TWEAKUI 98" topic in TIPS98.

- X-Setup: tweaks over 300 System settings

- Registry Styler 99: tweaks tons of Win98/IE System settings

- ItweakU LE: tweaks tons of System settings

- DirectControl: tweaks DirectX/Video/Audio/3D settings

- CacheMan: tweaks Disk/File cache settings

* Or better, hack the Registry yourself [like I do]... :)

In the following Registry editing tips, the subkeys/pathways in the Registry Editor left hand pane point to a specific subkey, String or Binary value (Hex or DWORD), located in the Registry right hand pane, with complete explanations of what they do, and how/why you may want to modify/rename/delete them and/or add new ones to customize/speed-up/fix your Windows 98/95 computer.

WARNING: FIRST BACKUP ALL YOUR HARD DRIVES TO A SAFE LOCATION BEFORE ATTEMPTING TO MAKE ANY CHANGES! *READ* the "REGISTRY BACKUP + RESTORE" chapter below for DETAILS! Take EXTREME CAUTION when modifying your System/Startup settings! Wrong Registry changes may result in System crashes/lockups/permanent data loss, or might lead to having you REINSTALL the ENTIRE Operating System! YOU are the ONLY one responsible for ANY changes YOU make! ALWAYS HAVE YOUR MOST RECENT SYSTEM BACKUP READY!

BEWARE: When you add/delete/modify a Registry (sub)key/value/etc by using RegEdit, ALL CHANGES TAKE PLACE INSTANTLY, AND YOU WILL NOT BE PROMPTED FOR CONFIRMATION UPON SAVING CHANGES OR BEFORE CLOSING THE REGISTRY EDITOR!

To learn about Registry editing, run Regedit.exe and click on Help. To learn MORE about the Registry structure:

- Win95/OSRx users: (double)-click on WIN95RK.HLP, found on your Win95 Setup CD-ROM, in the \Admin\Reskit\Helpfile folder,

- Win98/98 SE users: (double)-click on WIN98RK.HLP, found on your Win98 Setup CD-ROM, in the \Tools\Reskit\Help folder,and READ *CAREFULLY* the REGISTRY related TOPICS!

[BACK TO TOP]

 

 Registry backup + restore

 *** VERY IMPORTANT! HOW TO BACKUP/EXPORT YOUR REGISTRY *FIRST*:

A. Copy SYSTEM.DAT, USER.DAT (and if you use Win95, OSR1 or OSR2 copy also SYSTEM.DA0 and USER.DA0) to a safe location, such as a BACKUP disk (media): removable, (re)writable cd, tape or floppy.

NOTE: The Registry files are usually too large to fit on a single 1.44 MB floppy disk, therefore use a different media to back them up!

1. Create a DOS batch file called REGBAKUP.BAT (using Notepad) containing these lines (example):

@ECHO OFF

MD E:\REGBAKUP

ATTRIB -H -R -S +A C:\WINDOWS\SYSTEM.DA*

ATTRIB -H -R -S +A C:\WINDOWS\USER.DA*

COPY C:\WINDOWS\SYSTEM.DA* E:\REGBAKUP

COPY C:\WINDOWS\USER.DA* E:\REGBAKUP

presuming E is a removable backup drive. Change the paths to match your system setup.

2. Create a shortcut (.PIF file) to REGBAKUP.BAT in the Startup folder (C:\Windows\Start Menu\Programs\Startup), to backup the Registry files automatically (in the background) every time Win95/OSR1/OSR2 loads. Win98 does this automatically upon the first load of each day.

NOTE: Read the "SCANREGW, SCANREG + SCANREG.INI" topic in TIPS98 (included) for more Win98/98 SE Registry backup details.

B. To BACKUP the ENTIRE Registry to a .REG file (which is a plain text/ASCII file) from WITHIN Windows:

1. Open the Registry editor (C:\Windows\Regedit.exe).

2. Highlight "My Computer" main tree.

3. Click on the "Registry" menu item.

4. Select "Export Registry File...".

5. Type REGBAKUP.REG (or whatever filename you wish, just keep the .REG extension) in the "File name" field.

5. Browse to the drive and folder where you want REGBAKUP.REG to reside.

6. Click the Save button. Then you can open REGBAKUP.REG in a text editor, if you would like to make any changes. You canNOT use Notepad, because it is limited to a maximum filesize of only 64 KB. Bummer... :( Therefore you need to use a better text editor, that can handle very large text files, like Programmer's File Editor 32-bit for Windows 9x/NT (freeware, the best in my opinion): http://www.lancs.ac.uk/people/cpaap/pfe/

C. You can also EXPORT the ENTIRE Registry or only the keys/subkeys of your choice to a .REG file, ONLY from the native MS-DOS mode, using this REGEDIT command (example): REGEDIT /E E:\BACKUPS\REGBAKUP.REG presuming E is a removable backup drive. Change the paths to match your system setup. This exports the ENTIRE Registry to REGBAKUP.REG.

*** VERY IMPORTANT! HOW TO RESTORE/IMPORT/MERGE (INTO) YOUR REGISTRY:

A. To RESTORE the Registry files (i.e. after a system crash), FIRST exit Windows (or reboot) to the native/true/real MS-DOS mode.

IMPORTANT:

* To learn more about these issues, READ these included topics:

- For details on how to boot to the native MS-DOS prompt, read "COMPLETE MSDOS.SYS REFERENCE" in MYTIPS95.

- For details on how to exit Windows 9x to MS-DOS, read "EXIT TO DOS" in TIPS95.

- For details on more MS-DOS boot options, read "2 DOS OR NOT 2 DOS" in MYTIPS95.

- For details on how to PROPERLY recreate (compact/shrink) your Registry from an exported .REG file in Windows 9x, read

"SHRINK THE REGISTRY!" in MYTIPS95.

* Download FixReg [51 KB, freeware] to FIX the Windows 9x exported Registry recreation BUGs:

http://www.walbeehm.com/mrcode.html

1. Create a Registry BACKUP as explained above, using REGBAKUP.BAT described in the "HOW TO BACKUP/EXPORT YOUR

REGISTRY *FIRST*" topic (paragraph A) above.

2. Create a DOS batch file (using Notepad) called REGRESTR.BAT, or whatever else you want (but keep the .BAT extension), containing these lines (example):

@ECHO OFF

ATTRIB -H -R -S +A C:\WINDOWS\SYSTEM.DA*

ATTRIB -H -R -S +A C:\WINDOWS\USER.DA*

REN C:\WINDOWS\SYSTEM.DAT SYSTEM.001

REN C:\WINDOWS\USER.DAT USER.001

DEL C:\WINDOWS\*.DA0

COPY E:\REGBAKUP\*.DAT C:\WINDOWS

presuming E is a removable backup drive. Change the paths to match your system setup.

3. Place REGRESTR.BAT in a folder in your path, specified on your Autoexec.bat file PATH line.

4. Run REGRESTR.BAT from the native MS-DOS prompt, every time after you have been locked out of Windows, or experience sudden errors, and you KNOW this happened because of CHANGES you made to your Registry.

B. To IMPORT a .REG file (back) into the Registry from WITHIN Windows:

1. Open the Registry editor (C:\Windows\Regedit.exe).

2. Click on the "Registry" menu item.

3. Select "Import Registry File...".

4. Browse to the drive and folder where your .REG file resides.

5. Double-click on it, or click the Open button.

6. Answer OK to the confirmation prompt.

C. To IMPORT a .REG file (back) into the Registry, ONLY in native/true MS-DOS mode OUTSIDE Windows, use this REGEDIT command (example):

REGEDIT E:\BACKUPS\REGBAKUP.REG

presuming E is a removable backup drive. Change the paths to match your system setup.To see all available REGEDIT parameters, run: REGEDIT ONLY from the native MS-DOS prompt.

D. To (RE)CREATE the Registry from scratch using a .REG file that contains your ENTIRE Registry, ONLY in native/true MS-DOS mode OUTSIDE Windows, use this REGEDIT command (example): REGEDIT /C E:\BACKUPS\REGBAKUP.REG presuming E is a removable backup drive. Change the paths to match your system setup. To see all available REGEDIT parameters, run:

REGEDIT ONLY from the native MS-DOS prompt.

E. To MERGE (register) a .REG file (back) into the Registry from WITHIN Windows:

1. Start Explorer or File Manager.

2. Browse to the .REG file you want to merge.

3. (Double)-click on it.

4. Click Yes to proceed.

5. Answer OK to the confirmation prompt.

CAUTION: FAULTY CHANGES made to .REG files you import or merge/register into your Registry may LOCK UP/CRASH your machine, and/or generate UNEXPECTED system ERRORS!

[BACK TO TOP]

wowie@engineer.com

Windows 9x/NT4.0 Tricks, Tips,&Tweaks Index

Home

1