Jump to content
Sign in to follow this  
MMcBrine

Problem with RegDelete

Recommended Posts

MMcBrine

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

Share this post


Link to post
Share on other sites
PsaltyDS

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

Share this post


Link to post
Share on other sites
MMcBrine

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...

Share this post


Link to post
Share on other sites
PsaltyDS

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

Share this post


Link to post
Share on other sites
PsaltyDS

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

Share this post


Link to post
Share on other sites
MMcBrine

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

Share this post


Link to post
Share on other sites
MMcBrine

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...

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.