Browser

How to clear your Internet Explorer (version 7) cache from the command line


It seem that all I want to do these days is work from the command line and keep my mouse from working. The less I have to use my mouse, the happier it makes me. I wanted to share with you how to delete IE cache from the command line. Follow these simple steps.

Normally, you have to open IE and choose Tools | Delete Browsing History | Delete All...

Another way would be to open the command line and type the following commands:

  • RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255 (Deletes ALL History)
  • RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 1 (Deletes History Only)
  • RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 2 (Deletes Cookies Only)
  • RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8 (Deletes Temporary Internet Files Only)
  • RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 16 (Deletes Form Data Only)
  • RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 32 (Deletes Password History Only)

It works great; I even put together a quick video for your enjoyment.

39 comments
ToR24
ToR24

RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 9 This will delete the files (+8) and history (+1) in one step. I'm incorporating it into a logoff script and pushing it through group policy.

wortos
wortos

Works great for me! Also, you can type it in the Start\Run and it will work.

FXEF
FXEF

would I want to type all those long commands when I can clean things up with a few simple clicks? Come on guys, post some useful info here.

csadler
csadler

why would i want to type 6 or 7 complicated syntax commands when i can accomplish the same thing with one click of a button? or even a 3rd party cleaner that uses a 1-2-3 click process? idk maybe i just dont have as much time on my hands as some.

basil.cinnamon
basil.cinnamon

Error in Rundll32: Missing Entry: InetCpl.cpl, ClearMyTracksByProcess ???

michael
michael

Since I try to avoid IE7. And anyway, I prefer Firefox.

A.C
A.C

Temp internet files... set the option in internet options, advanced, to clear on IE close.... unless you are still using dial up! Form data and passwords.... never save them, it's a security risk, and if you are going to delete them, you might as well not have saved them in the first place.... That only leaves history and cookies... and unless you spend a lot of time surfing where you shouldn't....

kevin
kevin

Honestly, I cant believe you would go to the trouble, even with a batch file.

goran.perisic
goran.perisic

It is very usefull for people who like command line. :)

john
john

Super. easy, yet thorough.

we
we

What should I do for Internet Explorer 6?

Dilbert-Tom
Dilbert-Tom

Of course M$ will change some of the name(s) for 7.## so the batch file will need to be maintained - wouldn't it be nice if those 'buttons' could be copied to desktop as shortcuts ?

robertestx
robertestx

Create a batch file so I can use my mouse to double click it and launch a command line window where I don't have to type anything. :)

Photogenic Memory
Photogenic Memory

It's probably better to put it in a batch script. Perhaps like this.: [Delete my shorts in IE7, just funnin!] RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255 [Deletes ALL History] RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 1 [Deletes History Only] RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 2 [Deletes Cookies Only] RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8 [Deletes Temporary Internet Files Only] RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 16 [Deletes Form Data Only] RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 32 [Deletes Password History Only] echo This is house is clear! [saying from the movie Poltergiest] Copy and paste it into notepad then save as IE7cleanup.bat, right? I just copied and pasted what the author wrote and added the comment markers. Many thanks to the original poster. It's an interesting function of IE7. I haven't tested it yet but I did try to test it on in IE6( no go, LOL!). Anyways, this all seems abit overkill but what a great way to wipe out your tracks with just a click?! Hooray for IE7! I use Firefox by the way, hehe.

seanferd
seanferd

I had entirely forgotten about that. Although I don't use IE7, this will come in handy whenever similar options present themselves.

malconcel
malconcel

I guess if you have too much time on your hands at work and you're bored, you can type all those lines. But for myself, I'm too busy and I would just have to do it with the normal clicks. More power to the originator of this discussion. Let us know when you figure out another way to do something the LONG way!

bag
bag

If acces has been block via GPO, you wont have acces to the simple click like you say. Then you just create a simple cmd file and execute it before you leave at night. Et voila ../Bruno

Oktet
Oktet

he really does not want to use the "mouse (less than five mouse clicks), instead they enjoy the keyboard and command prompt (with more than 6 commands to type).

lanopschool
lanopschool

Thanks for the article. I have many remote clients that connect in by vpn. I think that the commands contained in a batch file would allow me to remotely execute it.

Steven S. Warren
Steven S. Warren

Go ahead and test and let us know. I have no desire to put 6 back on my systems.

seanferd
seanferd

Put the command line in a new shortcut on the desktop, and name it appropriately. Change the shortcut icon to suit your fancy. You can use a similar command to open a control panel app to a particular tab, if you find that useful for something. Check with microsoft on the syntax, I haven't done this since Win98. My very old example is: RUNDLL32.EXE shell32.dll,Control_RunDLL sysdm.cpl,@0,1 This would open device manager directly, rather than clicking My Computer > Properties > Device Manager tab.

demosthanese
demosthanese

More powerful than is healthy for me. lol o IP 25 helo mail from:emailspoof@yourdoman.com rcpt to:target@youdomain.com data to: from: subject: message . quit lolz when my stepdad gets email from elvis.

sleepin'dawg
sleepin'dawg

All the preceding stuff gives me a brain cramp. Under tools they have a clear record utility which allows selective clearance or clear all records. I don't use IE7 or FireFox mainly because they're both inadequate for speed and stability. Download Avant; it's free. It runs ontop of IE. I've been using it since IE6 and it just keeps geting better and better all the time. I dumped FireFox because it was way too slow and would freeze up on me from time to time. Avant is what IE7 should have been and could have been if it weren't for Microsnot's inability to avoid redundant code bloat. Opera isn't bad either and has BitComet or Torrent built into it but I haven't been using it long enough to give it an unqualified recommendation yet.

kaleem_uddin
kaleem_uddin

Thanks a lot and appreciate your reply. Regards,

bakerweb
bakerweb

Guess what it still uses explorer (hince internet explorer) Dur Dur Why do so many glue heads think they have defeated spyware and malicious code by just hiding the core of the problem?

Oktet
Oktet

the work out of work, thank you-works like a charm. Now there are three beautiful ways to delete the IE cache: from the command line, mouse, or bat. file. I personally love that bat. file.

allan
allan

I think we only need one line for the batch file with a variable (of course you need to be at the command prompt, can't use a click on an icon) So the batch file would be: RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess %1 Save this to IE7Cleanup.bat and call with the command IE7Cleanup 255 or IE7Cleanup 1 or whatever option you want.

jonfhancock
jonfhancock

I have users who call me up when their favorite website is "broken." Nine times out of ten, they just need to clear their cache. I make a batch file that clears their cache, and put it in an obscure place, then place a shortcut on the desktop, give it a pretty name, and a pretty icon. I do this on every machine I image now. Then, instead of telling them over the phone, open IE, click here, click there... no, not that one, the other one... ok, does it say "blah blah blah", You're in the wrong place, go back, and click here... no, your other left... I just say, "double click the icon labeled 'Fix the internet' on your desktop"... they think I'm a god among men for this. I can't thank you enough. @seanferd - Lobbest thou thy holy hand grenade...

seanferd
seanferd

A small point for you and the other naysayers. It is also useful for more than just typing in directly in a CLI.

Steven S. Warren
Steven S. Warren

Did it make you feel good to knock me. Thanks for adding something of value to the board. By the way, I am plenty busy.

kaleem_uddin
kaleem_uddin

Hi... I tried with IE6 and it does not work. I get a message(Error in InetCpl.cpl missing

Demo_Dog
Demo_Dog

RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255 fails for IE6. How did you come up with the 2 paramters to pass to the control panel? ??

seanferd
seanferd

1) No one mentioned malware. 2) Some folks use and/or admin OS other than Windows. Hence, explorer is not necessarily involved. 3) The cached information described above does not reside in the same locations or formats for both IE and Mozilla browsers. Hence, the above commands will not work for Firefox. 4) The guy only mentioned this because he (apparently) does not mostly/normally use/admin IE or Windows. He was pointing out that his batch setup may not be optimal due to this. He then thanked someone in a later post for pointing out functionality which would improve the script. 5) Five... is right out.

Photogenic Memory
Photogenic Memory

Apolgies for my ignorance. That's a great tip that I was unaware of! I remember that in Bash you can use the "set"(opposite is "unset") command to input a variable ( ex. set eat=myshorts ) in the environment and view it via "printenv". Looks like I'm going to have to bone up on my MSDOS emulator environment some more, LOL! However, what happens if you reboot? Will the variable stick around or will you have to make other modifications to the command.com(or whatever it's called) to the CLI? Thanks for the aforementioned response.

Photogenic Memory
Photogenic Memory

It's much appreciated. This was a good article. There's nothing like trying to simplify a lengthy CLI task into script that you can click on once and shebang!!; it all complete, LOL! I love those moments.

bonkyhead
bonkyhead

Steve is trying to help. Those of you who don't think his offering is worth your time, don't use IE7 or otherwise see no value in his post would really be better off saving the time you spent posting your negative outlook. BTW - those of you who said it took too long - you could have copied and pasted what was here. What a bunch of whiney babies!!!

acridweasel
acridweasel

I found this very useful. As bag stated above, if GPO has been set to lock this option out (as ours has) this is a way of circumventing it. Good for me so I can delete my history (nothing dodgy, I promise!) but also good to know the GPO lock-out is not infallible. As part of a two-person I.T. department, I have the privilege of dealing with all our users and their attitudes toward "proper usage". This usually involves doing whatever they can to do what they WANT, rather than what they SHOULD. Maybe malconcel had a bad night at the craps table, maybe he/she just got out of bed on the wrong side or perhaps our nay-saying friend doesn't have any idea of how ANY bit of knowledge in business (however small or "unimportant") can have a practical application that you just haven't yet discovered.