Function Reference

RegDelete

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.

 

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").

To access the (Default) value use "" (a blank string) for the valuename.

Deleting from the registry is potentially dangerous--please exercise caution!

It is possible to access remote registries by using a keyname in the form "\\computername\keyname". To use this feature you must have the correct access rights on NT/2000/XP/2003, or if you are using a 9x based OS the remote PC must have the remote regsitry service installed first (See Microsoft Knowledge Base Article - 141460).

 

Related

RegRead, RegWrite

 

Example


RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE", "TestKey")