 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
jaco0646
Joined: 07 Oct 2006 Posts: 3113 Location: MN, USA
|
Posted: Fri Sep 28, 2007 9:15 pm Post subject: IE Cache Delete (index.dat) |
|
|
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.
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 |
|
 |
Laszlo
Joined: 14 Feb 2005 Posts: 4710 Location: Boulder, CO
|
Posted: Sat Sep 29, 2007 2:30 pm Post subject: |
|
|
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 |
|
 |
jaco0646
Joined: 07 Oct 2006 Posts: 3113 Location: MN, USA
|
Posted: Sat Sep 29, 2007 4:19 pm Post subject: |
|
|
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 |
|
 |
Thrillski
Joined: 18 Jul 2007 Posts: 143 Location: South Florida
|
Posted: Thu Jul 24, 2008 11:06 pm Post subject: A script option |
|
|
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 |
|
 |
tank
Joined: 21 Dec 2007 Posts: 3700 Location: Louisville KY USA
|
Posted: Fri Jul 25, 2008 12:10 am Post subject: |
|
|
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 |
|
 |
Thrillski
Joined: 18 Jul 2007 Posts: 143 Location: South Florida
|
Posted: Sat Jul 26, 2008 3:41 pm Post subject: XP Warning |
|
|
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 |
|
 |
jaco0646
Joined: 07 Oct 2006 Posts: 3113 Location: MN, USA
|
Posted: Sun Aug 03, 2008 5:34 pm Post subject: Re: A script option |
|
|
| 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). @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 |
|
 |
Fry
Joined: 01 Nov 2007 Posts: 885
|
Posted: Mon Aug 04, 2008 12:13 am Post subject: |
|
|
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 |
|
 |
jaco0646
Joined: 07 Oct 2006 Posts: 3113 Location: MN, USA
|
Posted: Mon Aug 04, 2008 1:32 am Post subject: |
|
|
Thank you Fry. I knew the code was floating around here somewhere on the forum. I even posted in that thread and forgot about it. I'm curious to know what more your batch script deletes. Mind sharing? |
|
| Back to top |
|
 |
tank
Joined: 21 Dec 2007 Posts: 3700 Location: Louisville KY USA
|
Posted: Mon Aug 04, 2008 2:24 am Post subject: |
|
|
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 |
|
 |
Sean
Joined: 12 Feb 2007 Posts: 2462
|
Posted: Mon Aug 04, 2008 8:54 am Post subject: |
|
|
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 |
|
 |
tank
Joined: 21 Dec 2007 Posts: 3700 Location: Louisville KY USA
|
Posted: Mon Aug 04, 2008 12:16 pm Post subject: |
|
|
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 |
|
 |
ahklerner
Joined: 26 Jun 2006 Posts: 1381 Location: USA
|
Posted: Mon Aug 04, 2008 1:26 pm Post subject: |
|
|
| 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 |
|
 |
Sean
Joined: 12 Feb 2007 Posts: 2462
|
Posted: Mon Aug 04, 2008 3:23 pm Post subject: |
|
|
| 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 |
|
 |
Fry
Joined: 01 Nov 2007 Posts: 885
|
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|