CRegistry:DeleteKey


The DeleteKey method deletes the entore key or one of its values from the system registry.

Syntax

CRegistry:DeleteKey()

CRegistry:DeleteKey( sValName )

where

    sValName is the name of the value being deleted from the key.

    If no value name is specified, the entire key, including all its values, is deleted.

Examples

The following script deletes the entire registry key named sKeyName:

 

Reg = CRegistry:Open( sKeyName )

-- open the key and create a CRegistry object

Reg:DeleteKey()

-- delete the "MyVal" value from the key

 

The next script opens the key named sKeyName key and deletes two of its values:

 

Reg = CRegistry:Open( sKeyName )

-- open the key and create a CRegistry object

Reg:DeleteKey( "MyVal" )

-- delete the "MyVal" value from the key

Reg:DeleteKey( "AnotherVal" )

-- delete the "AnotherVal" value from the key

 

Related Topics

CRegistry class