Version: 8
restore

Contents

Method

RegistryDeleteValue

ModuleNativeServices
LibraryCore
Action

Delete a registry value.

Parameters

Hive (string): The registry hive which has to match one of the following long or short names, ignoring case:

Long NameShort Name
HKEY_CLASSES_ROOTHKCR
HKEY_CURRENT_CONFIGHKCC
HKEY_CURRENT_USERHKCU
HKEY_LOCAL_MACHINEHKLM

Subkey (string): The registry key to look for.

Name (string): The name of the registry value to delete under the key.

Return values

Status (string): The deletion status of the value. "Deleted value" if it has been deleted, else "Key does not exist" if there is no such containing key.

No result is returned if the value did not exist (so it could not be deleted) but the parent key did.

Prior to v4.2 the "Key does not exist" status was "Value does not exist" which was true but not as accurate.
Example
 NativeServices.RegistryDeleteValue(Hive:"HKLM", Subkey:"software\\vendor\\test\\test2", Name:"failedTestValue");
Platforms
  • Windows
Notes

 To delete a registry value for every user under HKU, use NativeServices.RegistryDeleteUserValues.