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.
This article describes how to create an .inf file to automatically deleteregistry entries.
To create an .inf file to automatically delete registry entries, followthese 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: