Deletes a key or value from the registry.
RegDelete ( "keyname" [, "valuename"] )
Parameters
| keyname | The registry key to delete. |
| valuename | [optional] The valuename to delete. |
Return Value
| Success: | Returns 1. |
| Special: | Returns 0 if the key/value does not exist. |
| Failure: | Returns 2 if error deleting key/value. |
| @error can be set to following values : | |
| 1 if unable to open requested key | |
| 2 if unable to open requested main key | |
| 3 if unable to remote connect to the registry | |
| -1 if unable to delete requested value | |
| -2 if unable to delete requested key/value |
Remarks
A registry key must start with "HKEY_LOCAL_MACHINE" ("HKLM") or "HKEY_USERS" ("HKU") or "HKEY_CURRENT_USER" ("HKCU") or "HKEY_CLASSES_ROOT" ("HKCR") or "HKEY_CURRENT_CONFIG" ("HKCC").
Related
RegRead, RegWrite
Example
RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE", "TestKey")