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. :roll:
I would be interested in any feedback on this one.
>DOWNLOAD<
IE Cache Delete (index.dat)
Started by
jaco0646
, Sep 28 2007 09:15 PM
19 replies to this topic
#1
-
Posted 28 September 2007 - 09:15 PM
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:
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:
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.
#2
-
Posted 29 September 2007 - 02:30 PM
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
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
#3
-
Posted 29 September 2007 - 04:19 PM
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.
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.
#4
-
Posted 24 July 2008 - 11:06 PM
Probably might want to mention this
If A_OSVersion != WIN_XP { MsgBox, 16, IE Cache Delete, Sorry, this program is only designed to run on Windows XP. ExitApp }
#5
-
Posted 25 July 2008 - 12:10 AM
Never lose.
WIN or LEARN.
WIN or LEARN.
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
Have a nice day!
Thrillski
#6
-
Posted 26 July 2008 - 03:41 PM
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:
"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.
#7
-
Posted 03 August 2008 - 05:34 PM
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
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
#8
-
Posted 04 August 2008 - 12:13 AM
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
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
#10
-
Posted 04 August 2008 - 02:24 AM
Never lose.
WIN or LEARN.
WIN or LEARN.
I think the correct syntax is:
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)
#11
-
Posted 04 August 2008 - 08:54 AM
i think he searches forum for com or the word sean every day either that or he is also psychic
thanks again Sean
thanks again Sean
#12
-
Posted 04 August 2008 - 12:16 PM
Never lose.
WIN or LEARN.
WIN or LEARN.
I think the correct syntax is:
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
#13
-
Posted 04 August 2008 - 01:26 PM
ʞɔпɟ əɥʇ ʇɐɥʍ
Have you checked the ErrorLevel after DllCall? There is no exported function like ClearMyTracksByProcess, only ClearMyTracksByProcessW in inetcpl.cpl in my system.why use the W version? the other version works just fine. and you dont need varsetcapacity or the other dll call
#14
-
Posted 04 August 2008 - 03:23 PM
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...e-command-line/
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...e-command-line/
#15
-
Posted 04 August 2008 - 07:18 PM