How to automatically clear IE7 browsing history when you logoff/shutdown?
This is especially useful when you have a computer that can be accessed by multiple users or public. To do this, you must first prepare a batch file to execute the various commands to clear the IE cache.
There are various cache that you can clear.
Temporary Internet Files
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8
Cookies
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 2
History
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 1
Form Data
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 16
Passwords
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 32
Delete All
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255
Delete All – “Also delete files and settings stored by add-ons”
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 4351
Simply create a file clearIE.bat and type in the command you want, corresponding to the cache that you want to clear. You can also combine multiple commands in the same clearIE.bat to achieve the result you wanted.
Next, fire up Group Policy Editor. Go to Start, Run, then type in gpedit.msc and hit OK.
There are 2 parts after this, depending if you want to clear the cache during logoff or shutdown.
To clear cache during logoff
- Inside Group Policy Editor, expand User Configuration > Windows Setting > Scripts (Logon/Logoff).
- On the right panel, select Logoff, right click and select Properties.
- On Logoff Properties window, click on Add.
- On Add a script window, click on Browse, navigate to the location where clearIE.bat is at, select it and click Open.
- Click OK, Apply then OK.
To clear cache during shutdown
- Inside Group Policy Editor, expand Computer Configuration > Windows Setting > Scripts (Startup/Shutdown).
- On the right panel, select Shutdown, right click and select Properties.
- On Shutdown Properties window, click on Add.
- On Add a script window, click on Browse, navigate to the location where clearIE.bat is at, select it and click Open.
- Click OK, Apply then OK.
That’s all. Just do some logoff and shutdown to make sure that the batch file is working.



This is awesome, except that XP Home doesn’t have group policy editor. D’oh! I’d also love to find a way to do this every time I exit IE as well…
Thanks for having such an insightful view on this topic. Adding you to my feed reader right now.
The tactics used by cookie stuffing affiliates can assortment from comparatively simple to complex and sophisticated methods. With new systems becoming found out and improved over a daily basis, affiliate networks have to set many time and cash into preventing these systems.
Do these work on windows 2003 with IE8?
thanks,jb
Superb post! It would be cool of there was a way to have a logon script that just parsed Active Directory..
Just wish to say your article is as surprising. The clearness in your post is simply nice and i could assume you are an expert on this subject. Fine with your permission let me to grab your feed to keep updated with forthcoming post. Thanks a million and please keep up the rewarding work.