Skip to main content

1E 9.x (on-premises)

NativeServices.RegistryDeleteKey

Method

RegistryDeleteKey

Module

NativeServices

Library

Core

Action

Delete a registry key.

Parameters

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

Long Name

Short Name

HKEY_CLASSES_ROOT

HKCR

HKEY_CURRENT_CONFIG

HKCC

HKEY_CURRENT_USER

HKCU

HKEY_LOCAL_MACHINE

HKLM

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

Return values

Status (string)

  • If the key was successfully deleted, set to "Deleted key".

  • If the key does not exist, nothing is returned, i.e. success no content.

  • If the parent key does not exist, set to (slightly misleadingly) "Key does not exist".

If some other registry error occurs, the method fails with a descriptive message.

Example

NativeServices.RegistryDeleteKey(Hive:"HKLM", Subkey:"software\\1e\\test\\test2");

Platforms

  • Windows

Notes

To delete keys in the HKEY_USERS hive, use NativeServices.RegistryDeleteUserKey.