Jump to content

How to delete Temporary Internet Files with a batch file?


benphp

Recommended Posts

This is pissing me off.

 

cd "C:\Documents and Settings\mylogin\Local Settings\Temporary Internet Files"
del *.*

 

This doesn't work either:

 

cd C:\Docume~1\mylogin\LocalS~1\Tempor~1
del *.*

 

Nor do variations of it.

 

In fact, if I navigate here in DOS, and do a DIR, it doesn't show the files.

 

WTF?

Try this

RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8
del "%USERPROFILE%\Local Settings\Temporary Internet Files\" /S /F

 

please note these are for Internet Explorer

 

 

EDIT: codes for the first line (IE8 )

255 (Deletes ALL History)
1 (Deletes History Only)
2 (Deletes Cookies Only)
8 (Deletes Temporary Internet Files Only)
16 (Deletes Form Data Only)
32 (Deletes Password History Only)

On any non web programming related forum, I would straight up assume you were trying to cover porn tracks.

 

Funny. I almost posted the reason for it, because I know the reason why most people want to do this. No - I'm using it for testing, and I need to clear my cache a lot without having to go through a menu to do it. PIA.

MadTechie,

 

Thanks for those - I might upgrade to IE7 just to get those to work - they won't work in IE6, apparently. I don't like IE7 though.

 

The ClearMyTracksByProcess is IE7+ but the command line should work!

 

of course if the files are stored elsewhere then it won't work

 

but try this as a batch file

echo off
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8
del "%USERPROFILE%\Local Settings\Temporary Internet Files\" /S /F /Q
RD "%USERPROFILE%\Local Settings\Temporary Internet Files\Content.IE5\" /S /Q
MD "%USERPROFILE%\Local Settings\Temporary Internet Files\Content.IE5"

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.