Delete a Registry Value Using a .REG File
Automating the removal of specific registry data in Windows is easily
accomplished using registration (.reg) files. This article
explains the exact syntax needed to delete an individual registry value
without deleting its parent key, followed by a step-by-step walkthrough
for creating and applying the file using the Windows Registry Editor
(Regedit).
The Syntax for Deleting a Registry Value
To delete a single value using a .reg file, set the
value name equal to a hyphen (-). This tells the Registry
Editor to remove that specific entry while leaving the key and any other
values inside it intact.
Step-by-Step Instructions
Open a Text Editor: Open Notepad or any plain text editor.
Add the Registry Header: The first line must declare the registry editor version:
Windows Registry Editor Version 5.00Specify the Key Path: Add a blank line, then enter the full path of the target registry key enclosed in square brackets:
[HKEY_CURRENT_USER\Software\YourTargetKey]Specify the Value to Delete: On the next line, type the value name in quotation marks, followed by an equals sign and a hyphen:
"YourValueName"=-Save the File: Click File > Save As. Choose All Files (.) in the “Save as type” dropdown, name the file with a
.regextension (for example,DeleteValue.reg), and save it.Apply the Changes: Double-click the saved
.regfile. Click Yes when prompted by User Account Control (UAC), then click Yes to confirm the merge operation.
Complete Example
Below is a complete example that removes a value named
DisableFeature from the ExampleApp key under
HKEY_CURRENT_USER:
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\ExampleApp]
"DisableFeature"=-
Deleting the (Default) Value
If you need to delete the unnamed (Default) value inside
a key rather than a named entry, use the @ symbol without
quotation marks:
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\ExampleApp]
@=-