DeleteKey

DeleteKey 是用于删除注册表键的函数。

语法

DeleteKey(路径)

返回结果

0 – 删除成功,故障时的错误代码。

示例

该脚本将删除注册表键:

函数 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 函数