Method:  WshShell.RegDelete

WshShell.RegDelete strName

The RegDelete method deletes an entry from the registry based on strName. If strName ends with a backslash (\), then strName is treated as a key, otherwise it is treated as a value. The strName parameter must begin with one of the following root key names:
HKEY_CURRENT_USER or HKCU
HKEY_LOCAL_MACHINE or HKLM
HKEY_CLASSES_ROOT or HKCR
HKEY_USERS
HKEY_CURRENT_CONFIG
The following VBScript code writes a key/value pair into the registry, reads and displays their content, and finally removes them from the registry.

Code:
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.RegWrite ("HKCU\MyNewKey\", 1 ,"REG_DWORD")
WshShell.RegWrite ("HKCU\MyNewKey\MyValue", "Hello world!")

WScript.Echo WshShell.RegRead("HKCU\MyNewKey\MyValue")
WScript.Echo WshShell.RegRead("HKCU\MyNewKey\")

WshShell.RegDelete "HKCU\MyNewKey\MyValue"
WshShell.RegDelete "HKCU\MyNewKey\"


Output:
Hello World!
1

Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information