davestiff has asked for the wisdom of the Perl Monks concerning the following question:

I am trying to create a Perl script to remove all dead OCX references from the registry. (Win32::Registry) So far it successfully does this with the exception of the references in the HKLM\SOFTWARE\Microsoft\Visual Basic\6.0 key. e.g. {043A3B20-756E-43E4-84AE-4624EBCECB1E}#5.1 Is there something special about this key that is preventing me from deleting? Or something I need to code differently? Thanks, Dave

Replies are listed 'Best First'.
Re: Delete Registry Key
by davidj (Priest) on Aug 03, 2004 at 13:01 UTC
    Check to see that HKLM\SOFTWARE\Microsoft\Visual Basic\6.0 key does not have subkeys. (Knowing how bloated Microsoft and VB are, my guess is that there are). According to the Win32::Registry (Win32::TieRegistry as well) documentation, a key cannot be removed if it has subkeys. The subkeys will have to be removed first.

    davidj

Re: Delete Registry Key
by inman (Curate) on Aug 03, 2004 at 13:01 UTC
    Can you post the code that you are using? It helps if we can see what you are trying!

    You might also want to look at Win32::TieRegistry as Win32::Registry has been deprecated.