Microsoft KB Archive/171424
Article ID: 171424
Article Last Modified on 1/20/2007
- Microsoft Windows 95
- Microsoft Windows 98 Standard Edition
- Microsoft Windows Millennium Edition
This article was previously published under Q171424
IMPORTANT: This article describes how to create and run an .inf file designed to delete registry entries automatically. Creating an .inf file to delete registry entries is a dangerous process. Do not attempt to do this unless you have made copies of your registry (System.dat and User.dat) files. These files are hidden files in the Windows folder. You should also verify that the .inf file you create works properly in your environment before using it in a production environment. Deleting registry entries incorrectly can cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that problems resulting from the incorrect use of this method can be solved. Use this method at your own risk.
This article describes how to create an .inf file to automatically delete registry entries.
To create an .inf file to automatically delete registry entries, follow these steps:
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:
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:
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
pathis 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.
Keywords: kbenv kbhowto KB171424