Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do I make the Internet Explorer 7 delete all private data on quit? I've found the option to clear the cache, but that does not clear cookies and the history.

share|improve this question
Are you sure there's no in-built option? (Been a long time since I used IE7!) This KB article seems to indicate a Delete browsing history on exit option (1, 2) that can clear cookies etc. If that doesn't help, guess you can try launching the browser from a batch file that then calls CCleaner. – Karan Jan 8 '13 at 0:31
Hi Karan! The Delete browsing history on exit option is only available in IE8 and above. It is the option I'm actually using to get things done in these newer IEs. Also, it is possible to clear cookies/cache/history/... from the command line (1). The problem with that approach is that my IE instance is launched by selenium webdriver, and not from a shell. – Jost Jan 8 '13 at 1:03
"The Delete browsing history on exit option is only available in IE8 and above." - Weird. I took the screenshots from the KB article, and according to Microsoft IE7 has that option (see the How to delete cookie files in Internet Explorer 7 section). IE6 lacks it, and you can clearly see the difference between IE7 and IE8's Delete browsing history dialog options (IE8 has more). – Karan Jan 8 '13 at 16:15
The screenshots seem to be taken in Windows Vista - I'm using Windows XP. Maybe there is a difference between those systems? – Jost Jan 8 '13 at 16:21
I don't think the same version of IE would offer different options based on the OS, but I'm not sure... – Karan Jan 8 '13 at 16:29
up vote 4 down vote accepted

The best you can do in IE7 is to go into Tools / Internet Options / Advanced Tab, scroll down and check the box "Empty Temporary Internet Files folder when browser is closed". However, there are reports that this doesn't work for cookies.

Therefore here is another solution that clears cookies every time that you logoff Windows.

First, prepare a batch file (.bat) that contains one or more of the following commands:

Clear Cookies
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 2

Temporary Internet Files
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8

RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 1

Form Data
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 16

RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 32

Delete All
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255

Delete All including files and settings stored by add-ons
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 4351

Then run the Group Policy Editor (gpedit.msc) and go to User Configuration / Windows Setting / Scripts (Logon/Logoff).

Right-click on Logoff and select Properties, click on Add, then on Browse, navigate-to and select the .bat file, click Open, OK, Apply, then OK.

Now when you logoff Windows the batch file will run and clean out your data.

share|improve this answer
Hi harry, I don't want to logoff and login again in into windows for each test run (Selenium). Even if it is possible to do that automatically, I'd probably need to run a command in the shell to do it. And if I do that, I could directly run one the above commands. So this does not help me, sorry. The list of commands is nice, though. – Jost Jan 11 '13 at 23:16
If you are really sure that nothing more is possible in with IE7, I'll accept your answer. – Jost Jan 11 '13 at 23:19
I don't know of and have not been able to find anything else, but this doesn't mean that it doesn't exist. I suggest waiting until the end of the bounty period in case somebody comes up with another answer. – harrymc Jan 12 '13 at 8:53
Because this is the best answer and noone seems to disagree with it, I accept it and award the bounty. – Jost Jan 16 '13 at 21:48

As far as I know, that happens when you use InPrivate Browsing.  Open a new tab and click on “Open an InPrivate Browsing window”, or select “InPrivate Browsing” from the “Tools” menu.  That seems to put you into a semi-sandbox that does not save things like cookies and history.  Of course you can download files and Add to Favorites.

share|improve this answer
Hi Scott! Good idea. The problem is: IE7 does not have InPrivate Browsing. That was introduced in IE8. I can't switch to IE8, because the I'm doing cross-browser testing and need to test the application in IE7. It would actually solve a lot of problems if InPrivate was available in IE6+. – Jost Jan 7 '13 at 22:40
D’oh! Also oops. – Scott Jan 7 '13 at 22:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .