User Tools

Site Tools


computer_science:deleting_registry_keys_and_values_from_a_reg_file

Deleting Registry Keys and Values

To delete a registry key with a .reg file, put a hyphen (-) in front of the RegistryPath in the .reg file. For example, to delete the Test

subkey from the following registry key:

HKEY_LOCAL_MACHINE\Software

put a hyphen in front of the following registry key in the .reg file:

HKEY_LOCAL_MACHINE\Software\Test

The following example has a .reg file that can perform this task.

[-HKEY_LOCAL_MACHINE\Software\Test]

To delete a registry value with a .reg file, put a hyphen (-) after the equals sign following the DataItemName in the .reg file. For example, to delete the TestValue registry value from the following registry key:

HKEY_LOCAL_MACHINE\Software\Test

put a hyphen after the “TestValue”= in the .reg file. The following example has a .reg file that can perform this task.

HKEY_LOCAL_MACHINE\Software\Test

“TestValue”=-

To create the .reg file, use Regedit.exe to export the registry key that you want to delete, and then use Notepad to edit the .reg file and insert the hyphen.

computer_science/deleting_registry_keys_and_values_from_a_reg_file.txt · Last modified: 2018/07/30 17:38 by cosmo