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?

Link to comment
Share on other sites

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)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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"

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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