How to delete Registry Key with Maximum rights
-
Hello,
I like to delete the key 'HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\Root\LEGACY_HTTP\0000' programatically in C++. I get Error 5 which is Access Denied. I tried calling ACL functions but i could not succeed. Can any one help me by giving code snipped through which i can delete the above mentioned Registry Key. -
Hello,
I like to delete the key 'HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\Root\LEGACY_HTTP\0000' programatically in C++. I get Error 5 which is Access Denied. I tried calling ACL functions but i could not succeed. Can any one help me by giving code snipped through which i can delete the above mentioned Registry Key.You must open the parent key by calling
RegOpenKeyEx()
with theDELETE
access right. Because the key is in HKLM, your code must be also executed as administrator. -
You must open the parent key by calling
RegOpenKeyEx()
with theDELETE
access right. Because the key is in HKLM, your code must be also executed as administrator.Thank you. I tried this option aswell, I could able to Delete keys under HKLM\Software\ but could not able to delete the key that i mentioned. I think i need to get access rights beyond Administrator rights inorder to delete the Registry enrty that i mentioned.
-
Thank you. I tried this option aswell, I could able to Delete keys under HKLM\Software\ but could not able to delete the key that i mentioned. I think i need to get access rights beyond Administrator rights inorder to delete the Registry enrty that i mentioned.
You are trying to delete a system key. Such keys can be only deleted by the owner (the user SYSTEM). If you really want to delete such a key (you should know what you are doing), you must change the access rights of the key (e.g. by allowing full access for administrators).
-
You are trying to delete a system key. Such keys can be only deleted by the owner (the user SYSTEM). If you really want to delete such a key (you should know what you are doing), you must change the access rights of the key (e.g. by allowing full access for administrators).
I checked my Administrator has Full right Access. But Still i could not delete the registry Key that i Mentioned.
-
I checked my Administrator has Full right Access. But Still i could not delete the registry Key that i Mentioned.
By default administrators did not have full access to system keys. See the MSDN article Registry Key Security and Access Rights[^] about accessing system keys.