AutoHotkey Community

It is currently May 27th, 2012, 10:51 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 13 posts ] 
Author Message
 Post subject: IE Cache Delete...
PostPosted: October 21st, 2006, 6:31 am 
Offline

Joined: July 21st, 2006, 6:13 am
Posts: 558
Here is a simple script I wrote to delete the IE Cache... Not much, just a little something I wanted to share...

Code:
#SingleInstance Force
#Persistent
#NoTrayIcon
#NoEnv
SetBatchLines, -1
Total_Cnt = 0
File_Cnt = 0
ToolTip
Gui, +AlwaysOnTop +ToolWindow
Gui, Color, Black
Gui, Font, s10 Bold
Gui, Add, Text, x19 y32 cLime, Searching for Temporary Internet Files
Gui, Show, w307 h85, Deleting IE Cache
SetWorkingDir, %A_Temp%   
GoSub, Get_Cnt
SetWorkingDir, C:\Documents and Settings\%A_UserName%\Cookies
GoSub, Get_Cnt
SetWorkingDir, C:\Documents and Settings\%A_UserName%\Local Settings\History
GoSub, Get_Cnt
SetWorkingDir, C:\Documents and Settings\%A_UserName%\Local Settings\Temporary Internet Files
GoSub, Get_Cnt
GuiControl, Hide, Static1
Gui, Add, Progress, x10 y45 w286 h20 Range0-%Total_Cnt% cLime
Gui, Add, Text, x10 y15 w75 cLime, Deleting  -
Gui, Add, Text, x90 y15 w205 cLime,
SetWorkingDir, %A_Temp%
Gosub, Loop
SetWorkingDir, C:\Documents and Settings\%A_UserName%\Cookies
Gosub, Loop
SetWorkingDir, C:\Documents and Settings\%A_UserName%\Local Settings\History
Gosub, Loop
SetWorkingDir, C:\Documents and Settings\%A_UserName%\Local Settings\Temporary Internet Files
Gosub, Loop
StringLen, String_Length, File_Cnt
If String_Length = 7
   X_Cord = 51
If String_Length = 6
   X_Cord = 55
If String_Length = 5
   X_Cord = 59
If String_Length = 4
   X_Cord = 63
If String_Length = 3
   X_Cord = 67
If String_Length = 2
   X_Cord = 71
If String_Length = 1
   X_Cord = 74
GuiControl, Hide, msctls_progress321
GuiControl, Hide, Static2
GuiControl, Hide, Static3
Gui, Font, s11 Bold
Gui, Add, Text, x0 y19 w350 cLime, All Internet Explorer cache has been deleted.
Gui, Add, Text, x%X_Cord% y50 cLime, Total Files Deleted = %File_Cnt%
Gui, Show, w307 h85, IE Cache Deleted
Return
GuiClose:
ExitApp
Get_Cnt:
If ErrorLevel = 1
   Goto, Skip_Get_Cnt
Loop, *.*, 1, 1
   Cnt = %A_Index%
If Cnt =
   Cnt = 0
Total_Cnt := Total_Cnt + Cnt
Skip_Get_Cnt:
ErrorLevel = 0
Return
Loop:
If ErrorLevel = 1
   Goto, Skip_Loop
Loop, *.*, 1, 1
{
   Progress_Cnt = 1
   FileDelete, %A_LoopFileFullPath%
   If ErrorLevel = 1
      Progress_Cnt = 2
   If ErrorLevel = 0
      File_Cnt++
   GuiControl, , Static3, %A_LoopFileName%
   GuiControl, , msctls_progress321, +%Progress_Cnt%   
}
Loop, *.*, 2, 1
{
   Progress_Cnt = 1
   FileRemoveDir, %A_LoopFileFullPath%, 1
   If ErrorLevel = 0
      File_Cnt++   
   GuiControl, , Static3, %A_LoopFileName%
   GuiControl, , msctls_progress321, +%Progress_Cnt%
}
Skip_Loop:
ErrorLevel = 0
Return


Last edited by aCkRiTe on November 30th, 2006, 9:38 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 21st, 2006, 7:23 am 
Offline
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
Dear ackrite, :)

I have not tried your script, but..
are you sure FileDelete can delete temporary files? :roll:

See: List/Remove Temporary Internet Files by Laszlo

Regards, :)

_________________
URLGet - Internet Explorer based Downloader
StartEx - Portable Shortcut Link


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 21st, 2006, 9:29 am 
Offline

Joined: July 21st, 2006, 6:13 am
Posts: 558
Im running Windows XP Pro and it deletes them on my machine under the following directories:

A_Temp
C:\Documents and Settings\%A_UserName%\Cookies
C:\Documents and Settings\%A_UserName%\Local Settings\History
C:\Documents and Settings\%A_UserName%\Local Settings\Temporary Internet Files

I have even double checked and it does. Why would it not delete them? Am I missing something here?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 21st, 2006, 10:28 am 
Offline
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
aCkRiTe wrote:
Why would it not delete them? Am I missing something here?


I do not know.. I have not tried your/Laszlo script.. But I remember Laszlo posted his script after this ask-for-help topic: Working with Temporary Internet Files

BTW, It is nice to know FileDelete works.

Regards, :)

_________________
URLGet - Internet Explorer based Downloader
StartEx - Portable Shortcut Link


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 24th, 2006, 2:41 am 
Offline

Joined: July 21st, 2006, 6:13 am
Posts: 558
Can Laszlo/anyone tell me if this script does not work for them? Im curious...


Report this post
Top
 Profile  
Reply with quote  
 Post subject: temp files
PostPosted: October 27th, 2006, 2:10 am 
Offline

Joined: October 7th, 2006, 4:50 pm
Posts: 3157
Location: MN, USA
After running this script, when you right-click on your Temporary Internet Files folder and click Properties, what information does it show? Does it say that it contains 0 files and 0 folders (meaning everything has truly been deleted)?

Sometimes there are hidden files and folders remaining. I believe that is the problem Goyyah is referring to.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 27th, 2006, 2:41 am 
Offline

Joined: July 21st, 2006, 6:13 am
Posts: 558
Thanks for the reply Jaco0646...
Yes, when I right click on the Temporary Internet Files folder and click Properties, it says there is only one folder and one file. It is the Content.IE5 folder and in it is the index.dat file. This is the same on all the other directories the script is ran on (except for the Content.IE5 folder part), only the index.dat file remains, as expected. Have you ran the script yourself Jaco0646? Thanks again for the reply...


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 27th, 2006, 2:59 am 
Offline

Joined: October 19th, 2006, 8:22 pm
Posts: 32
Location: mo
Hey
The script worked fine for me.
Gets rid of every thing it should
~Jason


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 14th, 2008, 5:57 pm 
for people who dont know this
this script does get rid of "visual files" but doesnt get rid of index.dat and the content.ie folder

If you open index.dat with a bin/hex editor you will be surprised to see it has all your viewed webpage history in it as well as other information as input field shortcuts and so on.

That is the file you want to get rid of but is locked by windows.

a script that deletes that would be nice.
Im checkng a few right now


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 14th, 2008, 6:31 pm 
Offline

Joined: June 26th, 2006, 6:14 pm
Posts: 1379
Location: USA
I thought the idea for this is from the forum, but i can not find any references to 'ClearMyTracksByProcess'. Here is a function:
Code:
ClearWebHistory(pCommand) {
   ValidCmdList    = Files,Cookies,History,Forms,Passwords,All,All2
   Files          = 8 ; Clear Temporary Internet Files
   Cookies       = 2 ; Clear Cookies
   History       = 1 ; Clear History
   Forms          = 16 ; Clear Form Data
   Passwords       = 32 ; Clear Passwords
   All          = 255 ; Clear all
   All2          = 4351 ; Clear All and Also delete files and settings stored by add-ons
   If pCommand in %ValidCmdList%
      DllCall("InetCpl.cpl\ClearMyTracksByProcess", uint, %pCommand%)
   Else
      MsgBox Invalid Command -%pCommand%-`nValid commands are`n%ValidCmdList%
   }

_________________
Image
ʞɔпɟ əɥʇ ʇɐɥʍ


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 15th, 2008, 2:22 am 
Offline

Joined: October 7th, 2006, 4:50 pm
Posts: 3157
Location: MN, USA
razlin1 wrote:
a script that deletes that would be nice.


http://www.autohotkey.com/forum/viewtopic.php?t=23684


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 15th, 2008, 3:10 am 
Offline
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
ahklerner wrote:
'ClearMyTracksByProcess'


Nice! .. but IE7 specific, I guess :(


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 15th, 2008, 2:03 pm 
Offline

Joined: April 19th, 2005, 10:26 am
Posts: 2250
Location: switzerland
here also a link to read index.dat :
http://www.foundstone.com/us/resources/ ... /pasco.htm
pasco.exe/cygwin1.dll

here script I used to to find and download music/video again from page once visited with IE:
http://www.autohotkey.com/forum/topic25556.html


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 44 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group