DeleteValue
DeleteValue 是用于删除注册表键中的值的函数。
语法
DeleteValue(路径, 值名称)
返回结果
0 – 删除成功,故障时的错误代码。
示例
该脚本将删除在以上的写示例中创建的注册表值:
函数 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 函数