Sign in to follow this  
Followers 0
d4rkdz

clearing internet explorer history

14 posts in this topic

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

Share this post


Link to post
Share on other sites



Read about Winsetstate() in help file.


----------------------------------------

:bye: Hey there, was I helpful?

----------------------------------------

My Current OS: Win8 PRO (64-bit); Current AutoIt Version: v3.3.8.1

Share this post


Link to post
Share on other sites

Read about Winsetstate() in help file.

it's not working for me

Run("RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255","",@SW_hide )
WinWait("[CLASS:#32770]")
WinSetState("[CLASS:#32770]", "", @SW_HIDE)

i got the class from window spy i took a screenshot

Posted Image

Share this post


Link to post
Share on other sites

bump for help please

Share this post


Link to post
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 & "*.*")

Share this post


Link to post
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")

Share this post


Link to post
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);


[size="5"] [/size]

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

Besides, whats the big deal if you see a pop up show up?

it become annoying to the users after a while

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

:thumbsup:

thanks

Share this post


Link to post
Share on other sites

Run("RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8")


Regards,
 

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  
Followers 0