How to Remove Windows 95/98 Registry Entries Automatically

This article has been archived. It is offered "as is" and will no longer be updated.
IMPORTANT: This article describes how to create and run an .inf filedesigned to delete registry entries automatically. Creating an .inf fileto delete registry entries is a dangerous process. Do not attempt to dothis unless you have made copies of your registry (System.dat andUser.dat) files. These files are hidden files in the Windows folder. Youshould also verify that the .inf file you create works properly in yourenvironment before using it in a production environment. Deleting registryentries incorrectly can cause serious problems that may require you toreinstall your operating system. Microsoft cannot guarantee that problemsresulting from the incorrect use of this method can be solved. Use thismethod at your own risk.
Summary
This article describes how to create an .inf file to automatically deleteregistry entries.
More information
To create an .inf file to automatically delete registry entries, followthese steps:

  1. Use any text editor (such as Notepad) to create the sample Del-reg.inf file shown below. Note that Del-reg.inf is not a required name, but it is used in these instructions.
          ; This file called  Del-Reg.INF deletes the registry entries listed      ; under the [RegChange] section.  In this example it deletes the      ; UserName value name under the key HKLM\network\Logon      [Version]      signature="$CHICAGO$"      [DefaultInstall]      ; DelReg = RegChange      [RunIt]      DelReg=RegChange      [RegChange]      HKLM,Network\Logon,username      HKLM,Network\Logon\keyname,						

Notes for this Sample File

  • The line below the [DefaultInstall] section is remarked out with a semicolon to prevent someone from accidentally running the .inf file. If you want the option to run the .inf file without using Rundll, you should remove the semicolon.
  • RunIt is an arbitrary section name in the .inf file that should be executed.
  • The value following RunIt has the following meanings:
    0 - Informs Windows 95 that a reboot is not necessary.
    1 - Always silent reboot
    2 - Always prompt reboot
  • Below the [RegChange] section is a value called username and a value called keyname to be deleted. These are sample entries and should be modified to list the registry entries that you want to be removed.
  • The entry in the [RegChange] section lists the registry entry or entries that you want to remove. Below are some guidelines for the proper syntax:
    root-key, sub-key, [value name]
    The value name is optional and is denoted by the [] brackets. The comma place holder shown above must be included in this line. Please note that if the sub-key or Value name contains spaces you need to use quotes. Registry entries between quotes may be case sensitive. For example:
          HKLM,SOFTWARE\"XYZ  inc"\settings,,						
    The root-key is represented by one of the following abbreviations:

    HKCR is short for HKEY_CLASSES_ROOT
    HKCU is short for HKEY_CURRENT_USER
    HKLM is short for HKEY_LOCAL_MACHINE
    HKU is short for HKEY_USERS
    The sub-key is the continuation of the path to the value to be changed, for example:
    HKLM,SOFTWARE\Microsoft\Windows\currentVersion\Fonts
    removes the Fonts Key and all of its contents.

    The value name entry allows the definition of a particular entry to be removed from a sub-key.
  • To run this sample file automatically when you log on to your computer, type the following line in the login script:
    RunDLL setupx.dll,InstallHinfSection RunIt 0 path\Del-Reg.inf
    where path is the location of the Del-reg.inf file. You can use a physical drive letter from your local computer and a path, or a Universal Naming Convention (UNC) path like \\server\sharename.
Properties

Article ID: 171424 - Last Review: 06/22/2014 18:26:00 - Revision: 4.0

  • Microsoft Windows 95
  • kbnosurvey kbarchive kbenv kbhowto KB171424
Feedback