Jump to content

clearing internet explorer history


 Share

Recommended Posts

hello sorry for asking many questions frequently

my script do clear internet explorer history/cache after anytime time it does visit a url (because pages won't show up correctly sometimes) using this line :

Run("RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255","",@SW_hide )

however this may be annoying because the removing bar keeps showing up everytime , isn't there a way to run in it silently or in background ? or is there another way to delete history and cookies and works on most of windows versions ?

thanks for the help

Link to comment
Share on other sites

I used this a long time ago for IE7. I haven't ran it recently and don't know if it still works.

; delete temporary internet files
$tif = RegRead("HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionExplorerShell Folders","Cache")
FileDelete($tif & "*.*")
; delete history
$hist = RegRead("HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionExplorerShell Folders","History")
FileDelete($hist & "*.*")
Link to comment
Share on other sites

I used this a long time ago for IE7. I haven't ran it recently and don't know if it still works.

; delete temporary internet files
$tif = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders","Cache")
FileDelete($tif & "\*.*")
; delete history
$hist = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders","History")
FileDelete($hist & "\*.*")

it's not working , i think it does treat the history files as actual files , also i added this line

$cook = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders","Cookies")
FileDelete($cook & "\*.*")

but it doesn't delete all the cookies , i have to put lile this :

FileDelete($cook & "\*.txt")
Link to comment
Share on other sites

Hello d4rkdz.

Try this and it'll work for you:

Run(@ComSpec & " /c RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255",@SW_HIDE);

it's like this :

Run(@ComSpec & " /C RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255","",@SW_HIDE);

and it shows that the history is being deleted right wich is the same as the line i posted in the op

Link to comment
Share on other sites

RunDll32.exe calls InetCpl.cpl (which is a DLL) on its entry point that has signature similar to:

DllMain($hWnd,$hInst,$lpstrCmdline,$nCmdShow)

Although Run calls RunDll32 and passes @SW_HIDE, InetCpl.cpl can totally ignore it. InetCpl.cpl wasn't meant to be called from outside apps although Microsoft published some of the calling interfaces to clean cookies, temp files, etc. I remember reading something a while back that using the InetCpl.cpl interface for removing files doesn't always clean up all the files . It has something to do with security mode it is in.

WinWait* functions won't work because InetCpl.cpl is running in its own separate process. It can block until it is completely finished, thus making WinWait* calls "too late" and never seeing the InetCpl.cpl window.

An option you have is to simulate InetCpl.cpl clean up behavior by locating all temp file locations, cookie folder, etc. and writing your own app. This is probably more hassle than its worth. Besides, whats the big deal if you see a pop up show up?

Edited by StringingLong
Link to comment
Share on other sites

Hey!

ICSweep is a perfect tool to use. I didn't find the original download, so I uploaded it to my own FTP... Download:

http://fredricz.com/ICSweep.exe

Parameters:

/ALL - Delete both Temporary Internet Files and Temp files

/TIF - Delete Temporary Internet Files only (Default)

/TMP - Delete Temp files only

/SIZE - Report the size of both Temporary Internet Files

and Temp files in each profile NOT in use. This

switch will also report the total size of

both Temporary Internet Files and Temp files NOT

in use. It DOES NOT DELETE any files.

/? - show this help file

More info:

http://www.ctrl-alt-del.com.au/files/ICSweep.txt

ICSweep download from Softpedia:

http://www.softpedia.com/get/System/System-Miscellaneous/ICSWEEP.shtml

Edited by Fredricz
Link to comment
Share on other sites

  • 2 months later...

dim $ClearID=255

dim $run=Run("RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess " & $ClearID)

while 1

if ProcessExists ($run) then

WinSetState ("[CLASS:#32770]","",@SW_disable)

else

exitloop

endif

wend

To community goes all my regards and thanks

Link to comment
Share on other sites

  • 3 months later...

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