Re: can't delete USB registry items...

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Daniel Miller (gorlash_at_community.nospam)
Date: 02/23/05


Date: Tue, 22 Feb 2005 17:51:49 -0800


"cristalink" <cristalink@nospam.nospam> wrote in
news:#VVXKfTGFHA.2568@TK2MSFTNGP10.phx.gbl:

>> They both failed, in the manner that I described in my message below.
>
> Sorry, I could not find the description of "the manner" in your post.
>
> I used SHDeleteKey and RegDeleteKey without any problem, as long as
> the proper permissions are set for the Enum key. Other keys'
> permissions don't need to be changed. What does GetLastError() say?
> What are the exact names of the keys you are trying to delete? Did you
> try your code on any other key to make sure it works at all?
>
Whoops!!! I got SHDeleteKey to work!!
I was passing the full registry path+entry name to SHDeleteKey (which I
read was required for RegDeleteKey, and assumed was necessary for
SHDeleteKey as well). I had tried RegDeleteKey both ways, but hadn't tried
both with SHDeleteKey...

So, I was putting a test case together to respond to your previous message,
and SHDeleteKey works, if I pass *just* the name that was returned
previously by RegEnumKeyEx... how odd...

Thank you for your responses and questions, CristaLink!!

            Dan Miller