DeleteKey

DeleteKey is a function used to delete registry keys.

Syntax

DeleteKey(Path)

Returns

0 – on deletion success, error number on failure.

Example

This script deletes a registry key:

Function Main

Dim Ro As Object

Dim result As Integer

Set Ro = Registry.Connect("127.0.0.1")

result = ro.DeleteKey("SOFTWARE\Microsoft\testkey")

If result = 0 Then

Echo "Value Deleted Successfully"

Else

Echo "Failed to Delete Value, Error code: " & result

End If

End Function