Using Registry Editor in Real Mode

This article was previously published under Q131352
This article has been archived. It is offered "as is" and will no longer be updated.
IMPORTANT: This article contains information about editing the registry.Before you edit the registry, you should first make a backup copy of theregistry files (System.dat and User.dat). Both are hidden files in theWindows folder.
SUMMARY
The registry is a system-wide database used for storing Windows 95 soft-ware and hardware configuration settings. The registry consists of theSystem.dat and User.dat files, which are located in the Windows folder.These files are backed up as System.da0 and User.da0 after everysuccessful boot of Windows 95.

Windows 95 includes a Registry Editor program (Regedit.exe) that runs inboth the real-mode MS-DOS environment and in the protected-mode Windowsenvironment. When you need to modify the registry without starting Windows95, use Registry Editor in real mode. Note that the switches listed inthis article only work in real-mode.
MORE INFORMATION
WARNING: Using Registry Editor incorrectly can cause serious problemsthat may require you to reinstall Windows 95. Microsoft cannot guaranteethat problems resulting from the incorrect use of Registry Editor can besolved. Use Registry Editor at your own risk.

NOTE: For information about how to edit the registry, view the ChangingKeys And Values online Help topic in Registry Editor (Regedit.exe). Notethat you should make a backup copy of the registry files (System.dat andUser.dat) before you edit the registry.

To export, modify, and then import registry data using Registry Editor inreal mode, follow these steps:
  1. Restart your computer. When you see the "Starting Windows 95" message, press the F8 key and then choose Safe Mode Command Prompt Only from the Startup menu.
  2. Change to the folder in which Windows 95 is installed by typing the following command at the command prompt, and then press ENTER
    cd\<windows>
    where <windows> is the folder in which Windows 95 is installed.
  3. Make a backup of the registry. To do so, type the following commands at the command prompt, pressing ENTER after each command:
    attrib -s -h -r *.dat
    copy user.dat user.sav
    copy system.dat system.sav
    For more information about backing up the registry, see the following article in the Microsoft Knowledge Base:
    132332 How to Back Up the Registry
  4. To export the registry to a text file, type the following command at the command prompt, and then press ENTER:
    regedit /e registry.txt
    This command exports both the System.dat and User.dat files. By default, the Registry.txt file is saved in the folder from which you run Registry Editor.

    To export a specific registry key to a text file, type the following command at the command prompt, and then press ENTER
    regedit /e regkey.txt <registry key>
    where <registry key> is the key you want to export. For example, type the following command:
    regedit /e regkey.txt "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ Microsoft Office\95\Microsoft Network"
    NOTE: This line is wrapped for readability. This should be typed as one line.
  5. Using a text editor (such as Edit.com), modify the Registry.txt file you created in step 4, and then save and close the file.
  6. To merge or import the text file back into the registry, type the following command at the command prompt, and then press ENTER:
    regedit registry.txt [without /c]
    If you want to create a new registry from the exported text file and replace the existing registry files, type the following command at the command prompt, and then press ENTER:
    regedit /c registry.txt
Creating a new registry file from exported text can be used as atroubleshooting technique to repair a damaged registry. For moreinformation about troubleshooting registry problems in real mode, see the"Using Real-Mode Registry Editor" section of the following article in theMicrosoft Knowledge Base:
131431 How to Troubleshoot Registry Errors in Windows 95
The changes take effect the next time you start Windows 95. If the changesyou make cause problems in Windows 95 or you want to revert to theregistry before you made the changes, restart your computer, press the F8key when you see the "Starting Windows 95" message, and then choose SafeMode Command Prompt Only from the Startup menu. At the command prompt,type the following commands, pressing ENTER after each command:
cd\<windows>
attrib -s -h -r *.dat
ren user.dat user.bad
ren system.dat system.bad
copy user.sav user.dat
copy system.sav system.dat
NOTE: If user profiles are enabled in Windows 95, the above procedure onlychanges the User.dat file in the Windows folder. It does not make anychanges to the User.dat file in the <windows>\profiles\<username> folder,(where <username> is the name you use to log on to Windows 95.

If you want to modify only the System.dat or User.dat file, or if there isa problem working with both the User.dat and System.dat file in oneregistry file, there are switches you can use that enable you to work withspecific files. For information about problems with importing a registrywith large keys, see the following article in the Microsoft KnowledgeBase:
132064 REGEDIT May Not Be Able to Import Registry with Large Keys
The following procedure gives the commands for changing step 4 above,which exports the entire registry, and step 6 above, which imports thetext file (in this instance, the User.dat file):

Step 4:

To export the User.dat file to a text file located in the root folder,type the following command at a command prompt, and then press ENTER:
regedit /l:c:\windows\user.dat /e c:\user.txt
Step 6:

To merge or import the User.txt file back into the registry, type thefollowing command:
regedit /l:c:\windows\user.dat c:\user.txt [without /c]
If you want to create a new User.dat file from the exported text file,thereby replacing the existing User.dat file, type the following commandat a command prompt, and then press ENTER:
regedit /c registry.txt

Syntax

The syntax and command-line switches for using Regedit to import to,create, or export from the registry in real mode are as follows:

To merge or import a text file into the registry, use the followingcommand:
regedit [/L:system] [/R:user] filename1
To create and replace an existing registry from a text file, use the /cswitch as follows:
regedit [/L:system] [/R:user] /C filename2
To export text from the registry, use the /e switch as follows:
regedit [/L:system] [/R:user] /E filename3 [regpath]


To see this list, type regedit /? at thecommand prompt.
Properties

Article ID: 131352 - Last Review: 12/04/2015 11:28:52 - Revision: 1.1

Microsoft Windows 95

  • kbnosurvey kbarchive KB131352
Feedback