RegistryDelete

Description

Deletes a key or a value for a key in the Windows system registry.

Syntax

RegistryDelete ( key, valuename )

Argument

Description

key

A string whose value is the key in the system registry you want to delete or whose value you want to delete.

To uniquely identify a key, specify the list of parent keys above it in the hierarchy, starting with the root key. The keys in the list are separated by backslashes.

valuename

A string containing the name of a value in the registry. If the specified key does not have a subkey, specifying an empty string deletes the key and its named values.

Returns

Integer. Returns 1 if it succeeds and -1 if an error occurs.

Usage

For more information about entries in the system registry, see RegistrySet.

Examples

Example 1

This statement deletes the value name Title and its associated value from the registry. The key is not deleted:

RegistryDelete( &

 "HKEY_LOCAL_MACHINE\Software\MyApp.Settings\Fonts", &

 "Title")

See also