AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

IE Cache Delete (index.dat)
Goto page 1, 2  Next
 
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
jaco0646



Joined: 07 Oct 2006
Posts: 3113
Location: MN, USA

PostPosted: Fri Sep 28, 2007 9:15 pm    Post subject: IE Cache Delete (index.dat) Reply with quote

Here is a program I wrote a long time ago to delete index.dat files without rebooting your computer, and also empty a few of the temp folders associated with Internet Explorer. I just recently cleaned up the code enough that I felt it would be worthwhile to post. Rolling Eyes

I would be interested in any feedback on this one.

>DOWNLOAD<



Last edited by jaco0646 on Sun Jan 06, 2008 4:58 pm; edited 3 times in total
Back to top
View user's profile Send private message Visit poster's website
Laszlo



Joined: 14 Feb 2005
Posts: 4710
Location: Boulder, CO

PostPosted: Sat Sep 29, 2007 2:30 pm    Post subject: Reply with quote

Good idea!

It deleted a lot of WU files, but kept 6 folders of Windows Update. Are they still needed?

When I clicked on Temp IE Files, I got the error dialog:
Code:

Error: Failed attempt to launch program or document:
Action: <\Local Settings\Temporary Internet Files>
Params: <>

The current thread will exit.

Specifically: The system cannot find the file specified.


   Line#
   057: Gui,Add,Text,x540 y380 cGray gjaco0646,jaco0646
   059: Gui,Show,,IE Cache Delete
   060: links = Static7|Static9|Static10
   061: SetTimer,URL,100
   062: Return
   064: Run,%A_AhkPath% /r "%A_ScriptFullPath%" Choose2
   066: ExitApp
--->   073: Run,%UserProfile%\Local Settings\Temporary Internet Files
   074: Return
   076: Gui,+OwnDialogs
   077: MsgBox,36,IE Cache Delete,Are you sure you want to delete these files?
   078: IfMsgBox,No
   079: Return
   080: Loop,%UserProfile%\Local Settings\Temporary Internet Files\*.*
   081: FileDelete,%A_LoopFileLongPath%

---------------------------
OK   
---------------------------

It is a consequence of my standard #NoEnv settings. It looks safer to use EnvGet explicitly.
Back to top
View user's profile Send private message
jaco0646



Joined: 07 Oct 2006
Posts: 3113
Location: MN, USA

PostPosted: Sat Sep 29, 2007 4:19 pm    Post subject: Reply with quote

Thank you for the feedback!

I added the EnvGet command at the top as you suggested. I notice that HomeDrive is also an environment variable... I'm surprised the script didn't give you trouble there as well.

I also added a loop to delete the folders from the Windows Update directory, thanks for pointing that out.

Finally, I fixed the Refresh function so that is also works when the script is compiled now.

-Regards
Back to top
View user's profile Send private message Visit poster's website
Thrillski



Joined: 18 Jul 2007
Posts: 143
Location: South Florida

PostPosted: Thu Jul 24, 2008 11:06 pm    Post subject: A script option Reply with quote

Good morning!

A most interesting program you have there. I have a question/feature request. Is there a way to make this "clean everything" and have that simply execute when this is run? I'd like to schedule a cleaning of this and not have to worry about the gunk piling up.

Thanks in advance!
Thrillski

PS: I looked over the code and it is WAY above my level of understanding.. Otherwise, I'd try to do it myself.
Back to top
View user's profile Send private message
tank



Joined: 21 Dec 2007
Posts: 3700
Location: Louisville KY USA

PostPosted: Fri Jul 25, 2008 12:10 am    Post subject: Reply with quote

Probably might want to mention this
Code:
If A_OSVersion != WIN_XP
{
 MsgBox, 16, IE Cache Delete, Sorry, this program is only designed to run on Windows XP.
 ExitApp
}

_________________

We are troubled on every side‚ yet not distressed; we are perplexed‚
but not in despair; Persecuted‚ but not forsaken; cast down‚ but not destroyed;
Back to top
View user's profile Send private message
Thrillski



Joined: 18 Jul 2007
Posts: 143
Location: South Florida

PostPosted: Sat Jul 26, 2008 3:41 pm    Post subject: XP Warning Reply with quote

As I run XP, it isn't a problem and having an error-trap routine I have found is a good thing.

Have a nice day!
Thrillski
Back to top
View user's profile Send private message
jaco0646



Joined: 07 Oct 2006
Posts: 3113
Location: MN, USA

PostPosted: Sun Aug 03, 2008 5:34 pm    Post subject: Re: A script option Reply with quote

Thrillski wrote:
I'd like to schedule a cleaning of this and not have to worry about the gunk piling up.


That's not a bad idea, and it was a quick thing to add. The script will now accept the command line parameter CleanAll which skips the GUI and empties the 6 folders silently. Note that the script doesn't know whether Windows Update has finished installing its downloaded installations, so if you schedule it to run regularly it may interfere with that (which at worst would cause WU to redownload the updates). All the warnings from the GUI still apply, of course (e.g. auto-login features may fail after deleting cookies).

The command line option is currently untested, so I'm posting it as a separate download. EDIT: to schedule an AHK script as a task, use the same syntax as Passing Command Line Parameters to a Script. For example:
Code:
"C:\Program Files\AutoHotkey\AutoHotkey.exe" "C:\Documents and Settings\UserName\Desktop\IECDv4.ahk" CleanAll


And finally, I know this script is redundant with IE7, which has a "Delete Browsing History" dialog that includes a "Delete All" button. I'm sure this could be called with a COM command, which tank may have already posted (as the resident IE expert). Wink @tank: if you do know the simple way to invoke IE7's native function, please post it (or a link) here, since it's extremely relevant.

Thanks to both of you for your interest.
Back to top
View user's profile Send private message Visit poster's website
Fry



Joined: 01 Nov 2007
Posts: 885

PostPosted: Mon Aug 04, 2008 12:13 am    Post subject: Reply with quote

Here im pretty sure this will work, I use a similar call in my batch script which deletes more temp folders than you can think of

heres the code list for pcommand variable

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


DllCall("InetCpl.cpl\ClearMyTracksByProcess", uint, %pCommand%)

Credits AHKLerner
Back to top
View user's profile Send private message
jaco0646



Joined: 07 Oct 2006
Posts: 3113
Location: MN, USA

PostPosted: Mon Aug 04, 2008 1:32 am    Post subject: Reply with quote

Thank you Fry. Smile I knew the code was floating around here somewhere on the forum. I even posted in that thread and forgot about it. Confused I'm curious to know what more your batch script deletes. Mind sharing?
Back to top
View user's profile Send private message Visit poster's website
tank



Joined: 21 Dec 2007
Posts: 3700
Location: Louisville KY USA

PostPosted: Mon Aug 04, 2008 2:24 am    Post subject: Reply with quote

those are som high praises dunno if i qualify as an expert of villiage idiot i opt on the latter
i have not posted said options the entirety of my knowledge is using COM to interact with DOM even tho i wold use the word expertise more likeself indulgent idiot

now if you say pretty please perhaps our lord and god of COM might point me at the appropriate msdn ref material and ill give it a crack i have found anything promising yet
every thing i found was like 100 lines of code i know there has to be a better way also u know u can just kill the temp folder and cookies folder altogether?

edit before i posted this response seems you guys found a post by ahk lerner the real ie expert
_________________

We are troubled on every side‚ yet not distressed; we are perplexed‚
but not in despair; Persecuted‚ but not forsaken; cast down‚ but not destroyed;
Back to top
View user's profile Send private message
Sean



Joined: 12 Feb 2007
Posts: 2462

PostPosted: Mon Aug 04, 2008 8:54 am    Post subject: Reply with quote

I think the correct syntax is:
Code:
sCmd := 255   ; Clear All
VarSetCapacity(wCmd,15,0)
DllCall("MultiByteToWideChar", "Uint", 0, "Uint", 0, "str", sCmd, "int", -1, "str", wCmd, "int", 8)
DllCall("inetcpl.cpl\ClearMyTracksByProcessW", "Uint", 0, "Uint", 0, "str", wCmd, "int", 0)
Back to top
View user's profile Send private message
tank



Joined: 21 Dec 2007
Posts: 3700
Location: Louisville KY USA

PostPosted: Mon Aug 04, 2008 12:16 pm    Post subject: Reply with quote

i think he searches forum for com or the word sean every day either that or he is also psychic
thanks again Sean
_________________

We are troubled on every side‚ yet not distressed; we are perplexed‚
but not in despair; Persecuted‚ but not forsaken; cast down‚ but not destroyed;
Back to top
View user's profile Send private message
ahklerner



Joined: 26 Jun 2006
Posts: 1381
Location: USA

PostPosted: Mon Aug 04, 2008 1:26 pm    Post subject: Reply with quote

Sean wrote:
I think the correct syntax is:
Code:
sCmd := 255   ; Clear All
VarSetCapacity(wCmd,15,0)
DllCall("MultiByteToWideChar", "Uint", 0, "Uint", 0, "str", sCmd, "int", -1, "str", wCmd, "int", 8)
DllCall("inetcpl.cpl\ClearMyTracksByProcessW", "Uint", 0, "Uint", 0, "str", wCmd, "int", 0)


why use the W version? the other version works just fine. and you dont need varsetcapacity or the other dll call
_________________

ʞɔпɟ əɥʇ ʇɐɥʍ
Back to top
View user's profile Send private message
Sean



Joined: 12 Feb 2007
Posts: 2462

PostPosted: Mon Aug 04, 2008 3:23 pm    Post subject: Reply with quote

ahklerner wrote:
why use the W version? the other version works just fine. and you dont need varsetcapacity or the other dll call

Have you checked the ErrorLevel after DllCall? There is no exported function like ClearMyTracksByProcess, only ClearMyTracksByProcessW in inetcpl.cpl in my system.
Back to top
View user's profile Send private message
Fry



Joined: 01 Nov 2007
Posts: 885

PostPosted: Mon Aug 04, 2008 7:18 pm    Post subject: Reply with quote

I disagree Sean, In m batch file i made use to this

RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 4351

Its works and does not use ClearMyTracksByProcessW so infact both ways will work

So your version is longer than actually needed

See this article

http://www.howtogeek.com/howto/windows/clear-ie7-browsing-history-from-the-command-line/
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group