Microsoft® Windows® Script Host RegDelete Method |
WSH Reference Version 1 |
Deletes from the registry the key or value named by strName.
object.RegDelete strName
Part Description object WshShell object. strName Key or value name to delete.
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
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".