DeleteValue

DeleteValue is a function used to delete values from the registry keys.

Syntax

DeleteValue(Path, ValueName)

Returns

0 – on deletion success, error number on failure.

Example

This script deletes the registry value created in the write example above:

Function Main

Dim Ro As Object

Dim result As Integer

Set Ro = Registry.Connect("127.0.0.1")

result = ro.DeleteValue("SOFTWARE\Microsoft\testkey", "testsubkey")

If result = 0 Then

Echo "Value Deleted Successfully"

Else

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

End If

End Function