Microsoft® Windows® Script Host
RegDelete Method
WSH Reference
Version 1

See Also                      Applies To


Description
Deletes from the registry the key or value named by strName.
Syntax
object.RegDelete strName
Parameters
Part Description
object WshShell object.
strName Key or value name to delete.
Remarks
If strName ends with a backslash character (\), this method deletes the key instead of the value. The strName parameter must begin with one of following root key names:

Short Long
HKCU HKEY_CURRENT_USER
HKLM HKEY_LOCAL_MACHINE
HKCR HKEY_CLASSES_ROOT
HKEY_USERS
HKEY_CURRENT_CONFIG

Example
The following example deletes a value and a key from the registry:
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.RegDelete "HKCU\ScriptEngine\Value" ' Delete value "Value".
WshShell.RegDelete "HKCU\ScriptEngine\Key\"  ' Delete key "Key".