Jump to content

Clear Internet Explorer History


Recommended Posts

I found a C++ version of Clearing the Internet Explorer History.

Is there anybody who can convert this program to AutoIT?

Maybe it can be implemented in AutoIT in a next version....

#include <UrlHist.h>
// Delete all items in History folder
HRESULT ClearHistory()
{
    IUrlHistoryStg2* pUrlHistoryStg2 = NULL;
    HRESULT hr = CoCreateInstance(CLSID_CUrlHistory,
        NULL, CLSCTX_INPROC, IID_IUrlHistoryStg2,
        (void**)&pUrlHistoryStg2);
    if (SUCCEEDED(hr))
    {
        hr = pUrlHistoryStg2->ClearHistory();
        pUrlHistoryStg2->Release();
    }
    return hr;
}
Link to comment
Share on other sites

Um...History is stored in a folder in the users home folder...sorry, doc and settings folder :)

; This is where we whip out the soap and bubbles
FileRecycleEmpty()
FileDelete(@UserProfileDir & "\Recent\*")
FileDelete(@UserProfileDir & "\Cookies\*")
FileDelete(@UserProfileDir & "\Local Settings\Temp\*")
FileDelete(@UserProfileDir & "\Local Settings\History\*")
FileDelete(@UserProfileDir & "\Local Settings\Temporary Internet Files\*")

Code snippet from CoreQuantum.com 's directory cleaning application, Mr. Clean.

FileDelete(@UserProfileDir & "\Local Settings\History\*")

The above line should do what you want.

Edited by MSLx Fanboy

Writing AutoIt scripts since

_DateAdd("d", -2, _NowCalcDate())
Link to comment
Share on other sites

Try this :) by JdeB

; autoit version: 3.0
; language:    english
; author:        jos van der zande
; email:          jdeb at autoitscript dot com
; Date: November 09, 2004
;
; script function: Show current IE "Typed URL history" and enables you to remove selected entries.
;IE needs to be closed or else your update is gone after closing IE.
;
#include <GUIConstants.au3>
; Variable definitions
Global $s_URLSite       ;Save field
Global $h_URLSite[26]   ;Array with the GUI Handles for URL History entries
Global $h_URLSite_CheckBox[26];Array with the GUI Handels for URL History Checkboxes
Global $H_Update, $H_Cancel ;Handles for Buttons
Global $BaseX = 5       ;Base X coordinate
Global $BaseY = -5        ;Base Y coordinate
Global $x,$y,$rc            ;helper variables
;
; ----------------------------------------------------------------------------
; Script Start
; ----------------------------------------------------------------------------
Opt ("GUICoordMode", 1)
GUICreate("Configure IE Typed history.  ", 400, 600)
; Create 25 Checkboxes and labels for each URL Typed Hustory Reg entry
For $x = 1 To 25
; read the registry entry
    $s_URLSite = RegRead("HKCU\Software\Microsoft\Internet Explorer\TypedURLs", "url" & $x)
; Create check box
    $h_URLSite_CheckBox[$x] = GUICtrlCreateCheckbox("", $BaseX, $BaseY + 20 * $x, 20, 20)
; Check the Checkbox if this registry entry contains text
    If $s_URLSite <> "" Then GUICtrlSetState($h_URLSite_CheckBox[$x], 1)
; show the registry content in a lable
    $h_URLSite[$x] = GUICtrlCreateLabel($s_URLSite, $BaseX + 25, $BaseY + 20 * $x, 350, 20)
Next
; Show update button and close button
$H_Update = GUICtrlCreateButton("Update", 140, 550)
; set the text when hover over the Update button
GUICtrlSetTip(-1, "Save all changes made to Registry")
$H_Cancel = GUICtrlCreateButton("Cancel", 210, 550)
; set the text when hover over the Cancel button
GUICtrlSetTip(-1, "Exit and ignore all changes made")
; Show the GUI
GUISetState(@SW_SHOW)
; Process GUI Input
;-------------------------------------------------------------------------------------------
While 1
; Get message from gui
    $RC = GUIGetMsg()
; Exit script when GUI is closed
    If $RC = $GUI_EVENT_CLOSE Then Exit
; Exit script when Cancel button is clicked
    If $RC = $H_Cancel Then Exit
; update registry with only the selected URL entries in the rigth sequence
    If $RC = $H_Update Then
        If 6 = MsgBox(4, 'Update registry', 'Sure you want to update the registry ?') Then
            $y = 1
            For $x = 1 To 25
                If GUICtrlRead($h_URLSite_CheckBox[$x]) = 1 Then
                    RegWrite("HKCU\Software\Microsoft\Internet Explorer\TypedURLs", "url" & $y, "REG_SZ", GUICtrlRead($h_URLSite[$x]))
                    $y = $y + 1
                EndIf
            Next
            For $x = $y To 25
                RegDelete("HKCU\Software\Microsoft\Internet Explorer\TypedURLs", "url" & $x)
            Next
        EndIf
        Exit
    EndIf
WEnd
Exit
Edited by JdeB

qq

Link to comment
Share on other sites

Um...History is stored in a folder in the users home folder...sorry, doc and settings folder :D

; This is where we whip out the soap and bubbles
FileRecycleEmpty()
FileDelete(@UserProfileDir & "\Recent\*")
FileDelete(@UserProfileDir & "\Cookies\*")
FileDelete(@UserProfileDir & "\Local Settings\Temp\*")
FileDelete(@UserProfileDir & "\Local Settings\History\*")
FileDelete(@UserProfileDir & "\Local Settings\Temporary Internet Files\*")

Code snippet from CoreQuantum.com 's directory cleaning application, Mr. Clean.

FileDelete(@UserProfileDir & "\Local Settings\History\*")

The above line should do what you want.

<{POST_SNAPBACK}>

Sorry, but as I mentioned in my other topic, this obviously doesn't work :)
Link to comment
Share on other sites

Try this :D by JdeB

; autoit version: 3.0
; language:    english
; author:        jos van der zande
; email:           jdeb at autoitscript dot com
; Date: November 09, 2004
;

<{POST_SNAPBACK}>

This is nice, but it is not what I'm looking for. I already found this version, but it doesn't clear the History. Only lines that were typed in the Internet Browser.

Please translate the C++ version and implement it in AUTOIT!! :)

Edited by JdeB
Link to comment
Share on other sites

Um...History is stored in a folder in the users home folder...sorry, doc and settings folder :D

FileDelete(@UserProfileDir & "\Local Settings\History\*")

The above line should do what you want.

<{POST_SNAPBACK}>

This does it. :) Edited by MHz
Link to comment
Share on other sites

This does it. :D

<{POST_SNAPBACK}>

Sorry, but it doesn't ... :)

It gives a new folder HISTORY.IE5 with 2 files in it: the cache file Index.dat (with all "History" links in it!) and the file Desktop.ini

So the Cache is still NOT cleared! :D

Link to comment
Share on other sites

I think the best way to Clear the Internet Explorer (History, Cookies and On and Offline-Files) is by clicking the buttons in the Internet Options Page, but the only way by clicking this automaticly is to write a script that opens the windows and click the buttons. I already made such a script, but I wonder if there isn't a more direct way to do this?

Is there a way to push a button directly by using Control's (or maybe DllCall?) without opening the corresponding Windows?

Link to comment
Share on other sites

I don't play with IE much anymore, but Index.dat cannot be deleted, atleast while in the host OS (just like you can't access the SAM database). The Desktop.ini just sets the icon that the History folder should use, that's there by default too.

...I just checked my IE, I guess most of the code snippet doesn't work (I use firefox, so it doesn't hurt me usually), but I know that the \Recent does work.

Writing AutoIt scripts since

_DateAdd("d", -2, _NowCalcDate())
Link to comment
Share on other sites

  • 2 years later...

Sorry, but it doesn't ... :)

It gives a new folder HISTORY.IE5 with 2 files in it: the cache file Index.dat (with all "History" links in it!) and the file Desktop.ini

So the Cache is still NOT cleared! ;)

Tried rebooting the computer after clearing it out?

IE has a nasty habbit of retaining history and typed URLs until after a reboot. I cleared out a friends history and it took me ages to figure out why it kept bringing up url's as I typed. I searched around on Google for a bit and the answer was reboot.

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