-
Deleting a Registry Key
I'm using the RegDeleteKey Api call to remove a key that was created by my
install program.
The call works fine under Win98, but fails in NT 4.0 because the Key contains
sub-keys.
The function returns error 5, which is Access Denied. However, If I go directly
into the registry
and manually delete the key WinNT has no problem with that. Any idea how
to obtain permission
to do this programmatically?
-
Re: Deleting a Registry Key
Daniel,
>However, If I go directly into the registry and manually delete the key WinNT has no problem with that.
Well, you aren't really going into the Registry. You are just using a
utility (probably Regedit or Regedt32) that displays the the contents
of the Registry. Those utilities use the Registry APIs too.
>Any idea how to obtain permission to do this programmatically?
There's no permission you can obtain, it's just a fact that you have
to work around.
When you delete a key with Regedit, it handles all the work of
recursively deleting any subkeys, and that's what you have to do too,
one way or another.
Mattias
__________________________________________________
Mattias Sjögren (MCP) - mattiass @ hem.passagen.se
VB+ http://hem.spray.se/mattias.sjogren/
Please send questions/replies to the newsgroups
-
Re: Deleting a Registry Key
Daniel,
>However, If I go directly into the registry and manually delete the key WinNT has no problem with that.
Well, you aren't really going into the Registry. You are just using a
utility (probably Regedit or Regedt32) that displays the the contents
of the Registry. Those utilities use the Registry APIs too.
>Any idea how to obtain permission to do this programmatically?
There's no permission you can obtain, it's just a fact that you have
to work around.
When you delete a key with Regedit, it handles all the work of
recursively deleting any subkeys, and that's what you have to do too,
one way or another.
Mattias
__________________________________________________
Mattias Sjögren (MCP) - mattiass @ hem.passagen.se
VB+ http://hem.spray.se/mattias.sjogren/
Please send questions/replies to the newsgroups
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks