Sign in to follow this  
Followers 0
Doxie

Delete Temporary Internet Files?

19 posts in this topic

Its me again :D

New script, new problems...

How do i delete Temporary Internet Files?

I tried the normal command FileDelete.

I tried this:

FileDelete(@HomeDrive & @HomePath & "\Local Settings\Temporary Internet Files\*.*")

FileDelete("C:\Documents and Settings\Doxie\Local Settings\Temporary Internet Files\*.*")

Non of them are working :huh2:

Advice please


Were ever i lay my script is my home...

Share this post


Link to post
Share on other sites



I even tried:

FileDelete("::{7BD29E00-76C1-11CF-9DD0-00A0C9034933}")

Its taken from the CLSID List, but it does not seem to work with FileDelete.


Were ever i lay my script is my home...

Share this post


Link to post
Share on other sites

could this be a double quotes issue? because of the spaces?

Documents and Settings

Temporary Internet Files

moo

Share this post


Link to post
Share on other sites

Because the file path contains spaces, it probably is needing additional quotes. see FAQ in help file for more info

Try these:

FileDelete('"' & @HomeDrive & @HomePath & '\Local Settings\Temporary Internet Files\*.*"')

FileDelete('"C:\Documents and Settings\Doxie\Local Settings\Temporary Internet Files\*.*"')

And I'm assuming Internet Explorer is not running when you try to delete thiese files :D


Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites

tried that myself and it didn't work.. I even tried @Comspec "del... etc" no effect.. then I just went through dos. this is where it got interesting.

I went to my temp internet folder ie (cd "C:\documents.....internet files\") it get's there fine.. bit if I type Dir.. I should get a list of the files there right?

Oddly enough it only responds with the volume label and "file not found" is that not odd? if I go through Ie (tools/internet options/settings/show files) I can see them all there clear as day..

moo :D

Share this post


Link to post
Share on other sites

ok so if you do "del /s" it will delete them.. but there is a catch. Seems IE holds a seperate database listing of the files. What you see through windows is not accurate. You can view the files in the CMD (sorry for saying dos earlier) by using a dir /s which says there are sub dirs in there.. but from your view in windows it looks like there isn't. This is the first clue that what you see is not really what you get.

So as a result.. while you delete the files.. you don't delete their reffrence and so don't actually get what you want.. well.. except the free space on your hard drive that is.

one of the many wonders of windows.

moo

Share this post


Link to post
Share on other sites

this is wierd. First time I ran it, the FileDelete returned that it was successful, yet, looking in the folder, the files were not deleted... the next time I ran it, the FileDelete returned an error. and when I browse there, it shows all the files still being there.

;del temp IE files.
$ietemp = @UserProfileDir & '\Local Settings\Temporary Internet Files\*.*' ;@UserProfileDir because my homedrive is not where my user profile is. 
if FileDelete($ietemp) =1 then 
   MsgBox(0,"del IE temp","success deleting IE temp: "& $ietemp)
Else
   MsgBox(0,"del IE temp","error deleting IE temp: " & $ietemp)
EndIf

you know, I notice that there's also folders in there, and am guessing that to really clear all the cache you'll want to get the names of those folders and delete those as well... maybe just DirRemove and then DirCreate "Temporary Internet Files" or use the _DirRemoveContents UDF in file.au3 to do it? (of course I have yet to try either of those and may be getting the errors deleting the cache because I'm browsing with IE right now...)

testing....


"I'm not even supposed to be here today!" -Dante (Hicks)

Share this post


Link to post
Share on other sites

ok so if you do "del /s" it will delete them.. but there is a catch. Seems IE holds a seperate database listing of the files. What you see through windows is not accurate. You can view the files in the CMD (sorry for saying dos earlier) by using a dir /s which says there are sub dirs in there.. but from your view in windows it looks like there isn't. This is the first clue that what you see is not really what you get.

So as a result.. while you delete the files.. you don't delete their reffrence and so don't actually get what you want.. well.. except the free space on your hard drive that is.

one of the many wonders of windows.

moo

ok, that makes sense. I was so ready to blame MS... leave it to them to make things within their own OS not work according to the regular game rules.

I wonder if there's a cmdline option for IE or someother way to clear the cache...


"I'm not even supposed to be here today!" -Dante (Hicks)

Share this post


Link to post
Share on other sites

You'll really need to have to use IE or some other operating system way of clearing it. Even without IE running, the index.dat file and probably several other files will be locked. There is probably a VBScript solution since it can access IE and/or Explorer objects. I'd recommend doing a google search for something like (If that doesn't find anything, change the keywords some):

"Temporary Internet Files" VBScript

Share this post


Link to post
Share on other sites

nothing of course from IE, but, looks like if you also delete index.dat you'll get rid of that databas cowsmo talks about


"I'm not even supposed to be here today!" -Dante (Hicks)

Share this post


Link to post
Share on other sites

ok so if you do "del /s" it will delete them.. but there is a catch. Seems IE holds a seperate database listing of the files. What you see through windows is not accurate. You can view the files in the CMD (sorry for saying dos earlier) by using a dir /s which says there are sub dirs in there.. but from your view in windows it looks like there isn't. This is the first clue that what you see is not really what you get.

So as a result.. while you delete the files.. you don't delete their reffrence and so don't actually get what you want.. well.. except the free space on your hard drive that is.

one of the many wonders of windows.

moo

Because it's a special folder. Just like the "recycle bin".

Here's a workaround:

Opt("MouseCoordMode", 0)
Run(@SystemDir & "\rundll32.exe shell32.dll,Control_RunDLL " & @SystemDir & "\inetcpl.cpl")
$Title1 = "Internet Options"
WinWait($Title1, "")
Sleep(500)
WinActivate($Title1, "")
Sleep(500)
ControlClick($Title1, "", "Button7")
Sleep(500)
$Title2 = "Delete Files"
ControlClick($Title2, "", "Button1")
Sleep(500)
ControlClick($Title2, "", "Button2")
Sleep(500)
WinActivate($Title1, "")
Sleep(500)

MouseMove(205, 219, 1)
$x = MouseGetCursor()

Do
$x = MouseGetCursor()
Sleep(500)
Until $x = 2

Sleep(500)
WinActivate($Title1, "")
Sleep(500)
Send("{ESC}")

If you run the script, it will do what's necessary and later when it's finished it will send the Escape key.

Share this post


Link to post
Share on other sites

Put your name where it says yourname .

c:
cd "C:\Documents and Settings\yourname\Local Settings\Temp"
del /q /s /f *.*
cd "C:\Documents and Settings\yourname\Local Settings\Temporary Internet Files"
del /q /s /f *.*
cleanmgr /sagerun:99

Share this post


Link to post
Share on other sites

cleanmgr /sagerun:99
found some notes on what cleanmgr does, and the /sageset:n records your actions to be performed again the next time /sagerun:n is run. so, /sagerun:99 would only clear the IE cache if that's what I'd used /sageset:99 to do that.

not picking your fix apart Bob, just looking into something I hadn't understood. It's just not quite the fix for clearing the IE cache on demand.


"I'm not even supposed to be here today!" -Dante (Hicks)

Share this post


Link to post
Share on other sites

You can change the number too .

(: if that helps ..

Share this post


Link to post
Share on other sites

If nothing helps you can use this:

IECache.zip

Free commandline Tool to show and delete IE-Cache. You can use several Filters or just do a iecache.exe /delete to blow away all.

arctor

Share this post


Link to post
Share on other sites

See I use Mozilla firefox so I don't use them . :D

Share this post


Link to post
Share on other sites

 
RunWait("cleanmgr.exe /sagerun:99")
 
If @error = 0 Then
MsgBox(64, "Success", "Cleanup Success", 5)
ElseIf @error > 0 Then
MsgBox(16, "ERROR", "Cleanup Failed", 5)
EndIf

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0