Jump to content

[Solved]RegDelete() Not working well...


Recommended Posts

First of all, I know, and I'm sorry that there were similar questions relate to this topic.

However, I wasn't able to solve the problem by myself.

Also, English is not my first language, so please be generous(?) on some mistakes in communication.

#NoTrayIcon
#RequireAdmin
;~ #include <GUIConstantsEx.au3>
Global Const $GUI_EVENT_CLOSE = -3

Opt("MustDeclareVars", 1)
If @OSVersion = 'win_7' Then
    _W7IEicon()
Else
    MsgBox(16,"Error","This program is for Window7 only",10)
EndIf


Func _W7IEicon()

    Local $sIE,$bGen,$bDel,$msg,$sReg,$sReg2
    
    $sReg2 = '\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\{871C5380-42A0-1069-A2EA-08002B30302D}'
    If @OSArch = "X64" Then
        $sIE = '"C:\Program Files (x86)\Internet Explorer\iexplore.exe"'
        $sReg = "HKCR64\CLSID\{871C5380-42A0-1069-A2EA-08002B30302D}"
        $sReg2 = 'HKLM64' & $sReg2
    Else
        $sIE = '"C:\Program Files\Internet Explorer\iexplore.exe"'
        $sReg = "HKCR\CLSID\{871C5380-42A0-1069-A2EA-08002B30302D}"
        $sReg2 = 'HKLM' & $sReg2
    EndIf

    GuiCreate("",130,75,@DesktopWidth / 2 - 103/2, @DesktopHeight / 2 - 75/2)
    $bGen = GUICtrlCreateButton("Make Icon",10,10,110)
    $bDel = GUICtrlCreateButton("Delete Icon",10,40,110)
    GUISetState()
    
    While 1

        $msg = GUIGetMsg()

        Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop

        Case $msg = $bGen
            
            RegDelete($sReg)
            RegWrite($sReg,'','REG_SZ','Internet Explorer')
            RegWrite($sReg,'InfoTip','REG_SZ','@C:\Windows\System32\ieframe.dll,-881')
            RegWrite($sReg2)

        Case $msg = $bDel
            RegDelete($sReg)
            RegDelete($sReg2)

        EndSelect
        
    WEnd
EndFunc

It generate IE icon without any problem.

However, when I press "Delete Icon" button, the folder icon named "Internet Explorer" remains.

I have looked up the registry and found out that

HKCR\CLSID\{871C5380-42A0-1069-A2EA-08002B30302D}

HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\{871C5380-42A0-1069-A2EA-08002B30302D}

were not deleted.

I was able to delete those keys manually with the registry editor.

When I delete the second key (HKML one), the icon on the desktop disappears successfully.

I already tried followings:

1. turn off the anti-virus program

2. instead of using variables, tried both RegDelete('HKLM\... & RegDelete('HKLM64\...

3. turn off the UAO

is there something that I'm missing??

Edited : simplified and removed most of "RegWrite()" lines to show more clearly.

as posted below, the problem have solved by UPDATING to AUTOIT3.3.6.0 from autoit3.3.4.0

Edited by WannaLearn
Link to comment
Share on other sites

Oh, I also have tried the following code...

which showed me a popup box saying that

errors = -2

Extended = 2

#RequireAdmin

RegDelete("HKLM64\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\{871C5380-42A0-1069-A2EA-08002B30302D}")
$Err = @Error
$Ext = @Extended
Sleep(100)
MsgBox(0,"errors","error= "&$Err&@CRLF&"Extended= "&$Ext)
Link to comment
Share on other sites

  • Moderators

WannaLearn,

You need a certain number of posts before some of the board functions become activated. However with a nickname like yours I cannot imagine that will take too long! :(

Glad you solved your problem yourself - always more satisfying that way. :)

M23

P.S. And your English is fine. :idea:

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Welcome to the forums and please be patient with M23, we haven't got him fully trained yet.

Go to the original post, click "EDIT" and then click the "Use Full Editor" button. That should allow you to modify the thread title.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

  • Moderators

Hi George,

No one else to bug today? :idea:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Welcome to the forums and please be patient with M23, we haven't got him fully trained yet.

Go to the original post, click "EDIT" and then click the "Use Full Editor" button. That should allow you to modify the thread title.

It seems like I don't have a enough authority for edit yet... since I can't find a "EDIT" button.

Thank you anyway :idea:

ps. after the 5th post, now I can edit my posts

thank you

Edited by WannaLearn
Link to comment
Share on other sites

WannaLearn,

You need a certain number of posts before some of the board functions become activated. However with a nickname like yours I cannot imagine that will take too long! :)

Glad you solved your problem yourself - always more satisfying that way. :(

M23

P.S. And your English is fine. :)

Thnk you for the information :idea:

I hope it won't take too long :)

Link to comment
Share on other sites

Hi George,

No one else to bug today? :idea:

M23

Sure I have, but your name came out of the hat. I can picture Jos wiping his brow in relief because on a day like this it's usually his name that comes popping out.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

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