AutoHotkey Community

It is currently May 25th, 2012, 4:40 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 20 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: September 28th, 2007, 10:15 pm 
Offline

Joined: October 7th, 2006, 4:50 pm
Posts: 3157
Location: MN, USA
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<

Image


Last edited by jaco0646 on January 6th, 2008, 5:58 pm, edited 3 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 29th, 2007, 3:30 pm 
Offline

Joined: February 14th, 2005, 4:05 pm
Posts: 4710
Location: Boulder, CO
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 29th, 2007, 5:19 pm 
Offline

Joined: October 7th, 2006, 4:50 pm
Posts: 3157
Location: MN, USA
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject: A script option
PostPosted: July 25th, 2008, 12:06 am 
Offline

Joined: July 18th, 2007, 5:45 am
Posts: 151
Location: South Florida
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 25th, 2008, 1:10 am 
Offline
User avatar

Joined: December 21st, 2007, 3:14 pm
Posts: 3825
Location: Louisville KY USA
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
}

_________________
No matter what your oppinion Please join this discussion
Formal request to Polyethene
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject: XP Warning
PostPosted: July 26th, 2008, 4:41 pm 
Offline

Joined: July 18th, 2007, 5:45 am
Posts: 151
Location: South Florida
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Re: A script option
PostPosted: August 3rd, 2008, 6:34 pm 
Offline

Joined: October 7th, 2006, 4:50 pm
Posts: 3157
Location: MN, USA
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 4th, 2008, 1:13 am 
Offline

Joined: November 1st, 2007, 10:03 pm
Posts: 885
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 4th, 2008, 2:32 am 
Offline

Joined: October 7th, 2006, 4:50 pm
Posts: 3157
Location: MN, USA
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?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 4th, 2008, 3:24 am 
Offline
User avatar

Joined: December 21st, 2007, 3:14 pm
Posts: 3825
Location: Louisville KY USA
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

_________________
No matter what your oppinion Please join this discussion
Formal request to Polyethene
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 4th, 2008, 9:54 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
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)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 4th, 2008, 1:16 pm 
Offline
User avatar

Joined: December 21st, 2007, 3:14 pm
Posts: 3825
Location: Louisville KY USA
i think he searches forum for com or the word sean every day either that or he is also psychic
thanks again Sean

_________________
No matter what your oppinion Please join this discussion
Formal request to Polyethene
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 4th, 2008, 2:26 pm 
Offline

Joined: June 26th, 2006, 6:14 pm
Posts: 1379
Location: USA
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

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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 4th, 2008, 4:23 pm 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 4th, 2008, 8:18 pm 
Offline

Joined: November 1st, 2007, 10:03 pm
Posts: 885
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/


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 20 posts ]  Go to page 1, 2  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bon, Google Feedfetcher, Rajat, sarevok9, XX0 and 17 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