Deleting Registry Entries

Like most network administrators I used registry files to quickly insert values into the registries of clients on the network. Scripting these with a standard .reg file was the way to go and these files were simple to create and deploy. Although there may be other methods to enter information in the registry now, these scripts still have a place in the admin toolbox.

What many admins, including myself, never seemed to realize was that the .reg specification allowed for the removal of registry entries also. Here's a quick table of how to delete varies types of entries and a sample below. (Note the minus sign and location in each sample.)

Deleting Data "TestValue"=""
Deleting a Value "TestValue"=-
Deleting a Key [-HKEY_CURRENT_USER\Environment\test]

REGEDIT4
[HKEY_CURRENT_USER\Environment\test]
"TestValue"=""
[HKEY_CURRENT_USER\Environment\test]
"TestValue"=-
[-HKEY_CURRENT_USER\Environment\test]