IRegistryKey.DeleteSubKey

Syntax

DeleteSubKey(SubKeyName: String);

Parameters

SubKeyName. Name of the subkey that should be deleted.

Description

The DeleteSubKey method deletes the registry subkey, which value is sent by input parameter.

Comments

If the subkey does not exist, the method does nothing.

Example

Add a link to the Registry system assembly.

Sub UserProc;
Var
    RegKey: IRegistryKey;
Begin
    RegKey := RegistryClass.CurrentUser;
    If RegKey.SubKeyExists("Software\MyProject\Params"Then
        RegKey.DeleteSubKey("Software\MyProject\Params");
    End If;
End Sub UserProc;

After executing the example the subkey [HKEY_CURRENT_USER\Software\MyProject\Params] is searched in the registry. If the subkey exists, it is deleted.

See also:

IRegistryKey