Jump to content

Delete Temporary Internet Files?


Recommended Posts

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...

Link to comment
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!
Link to comment
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

Link to comment
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

Link to comment
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)

Link to comment
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)

Link to comment
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

Link to comment
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.

Link to comment
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
Link to comment
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)

Link to comment
Share on other sites

  • 9 years later...

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...