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

  1. Open a Text Editor: Open Notepad or any plain text editor.

  2. Add the Registry Header: The first line must declare the registry editor version:

    Windows Registry Editor Version 5.00
  3. Specify 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]
  4. 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"=-
  5. Save the File: Click File > Save As. Choose All Files (.) in the “Save as type” dropdown, name the file with a .reg extension (for example, DeleteValue.reg), and save it.

  6. Apply the Changes: Double-click the saved .reg file. 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]
@=-