How to Delete Keys from the Windows NT RegistryLast reviewed: September 25, 1995Article ID: Q127990 |
The information in this article applies to:
There are two ways to delete registry keys: use REGEDT32.EXE or call RegDeleteKey() from your application. The documentation for RegDeleteKey() points out that the specified key to be deleted must not have subkeys. If the key to be deleted does have subkeys, RegDeleteKey() will fail with access denied. This happens despite the fact that the machine account has delete privileges and the registry handle passed to RegDeleteKey() was opened with delete access. The additional requirement is that the key must have no subkeys. This limitation does not exist in 16-bit Windows. The difference exists in Windows NT because of atomicity and security considerations that 16-bit Windows does not have. You can select a key with subkeys and delete it with REGEDT32. This is because REGEDT32 recursively deletes the subkeys for you, making multiple call to RegDeleteKey(). You should use recursive subkey deletion in your application as well, if you need to delete keys that have subkeys.
|
Additional reference words: 3.50
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |