win32api.RegDeleteKey

RegDeleteKey(key, subKey)

Deletes the specified key. This method can not delete keys with subkeys.

Parameters

key : PyHKEY/int

An already open key, or any one of the following win32con constants:
HKEY_CLASSES_ROOT
HKEY_CURRENT_USER
HKEY_LOCAL_MACHINE
HKEY_USERS

subKey : string

The name of the key to delete. This key must be a subkey of the key identified by the key parameter. This value must not be None, and the key may not have subkeys.

Comments

If the method succeeds, the entire key, including all of its values, is removed. If the method fails, and exception is raised.

Win32 API References

Search for RegDeleteKey at msdn, google or google groups.