Jump to content

Problem with RegDelete


MMcBrine
 Share

Recommended Posts

Hi All,

I have been pulling my hair out and I am hoping that some kind soul can save what is left. I have been through the forums and read the required posts, and the help docs.

The System is Vista64 and I am running with Admin privliages.

I have a script that is required to delete

HKEY_CLASSES_ROOT64\Installer\Products\5798354A2F28CC3488C6ECA171F430AF

I am passing the key to a function and it is returning 2.

The subkeys are getting deleted just fine..

Thanks for the help

--Mike

RemoveRegistryEntries("HKEY_CLASSES_ROOT64\Installer\Products\5798354A2F28CC3488C6ECA171F430AF")

Func RemoveRegistryEntries($Key)
        
        $nResult = RegDelete($Key)
        If ($nResult = "1") Then
            ConsoleWrite($Key & " ... ")
            ConsoleWrite("Done" & @CRLF)
        ElseIf ($nResult = "2") Then
            ConsoleWrite($Key & " ... ")
            ConsoleWrite("ERROR deleting key." & @CRLF)
        ElseIf ($nResult <> "0") Then
            ConsoleWrite($Key & " ... ")
            ConsoleWrite("ERROR: " & @error & @CRLF)
        EndIf
EndFunc
Edited by MMcBrine
Link to comment
Share on other sites

You'll have to save @error to a variable immediately after RegDelete() is you want to report it. Else @error is reset by other functions that were run in the mean time.

Any chance that key is linked to the same one in 32bit side (HKCR vice HKCR64)? You might have to empty both before it could be deleted.

I might be wrong, no 64-bit to try it on here.

:)

Edited by PsaltyDS
Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

You'll have to save @error to a variable immediately after RegDelete() is you want to report it. Else @error is reset by other functions that were run in the mean time.

Any chance that key is linked to the same one in 32bit side (HKCR vice HKCR64)? You might have to empty both before it could be deleted.

I might be wrong, no 64-bit to try it on here.

:)

I have tried it for both, and get the same results for the HKCR64 but it reports the HKCR is not present. I tried it on a 32Bit system and it worked fine...

Link to comment
Share on other sites

I have tried it for both, and get the same results for the HKCR64 but it reports the HKCR is not present. I tried it on a 32Bit system and it worked fine...

Did you fix the @error checking to see what it reported? Also, is it completely empty before you tried to delete it, including the default ("") value?

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Did you compile with 32-bit AutoIt and then run it on 64-bit Windows? You might want to review BugTrac #961.

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Did you compile with 32-bit AutoIt and then run it on 64-bit Windows? You might want to review BugTrac #961.

:)

Morning and thanks for the help, I did fix the @error issue, and it is a 32bit Exe running on an X64 system, I did look at the bug report and it appears that it is the same issue. I can delete all subkeys/values below the HKCR64/Installer/Products/<NUMBER>. All operations on the HKLM and HKLM64 worked fine. Looks like I might have to compile 2 exe's?

I and going to try the test code in the bug DI and see what it reports.

Cheers

--Mike

Link to comment
Share on other sites

I tried the test code that was included in the DI, the first on that was for the 32bit registry on the X64 failed the delete, and when X64 was compiled as an X64 EXE it worked fine. Looks like I am getting bit by this bug... Sure hope they are able to fix it...

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...