Subscribe to How-To Geek

Recommended: Click Here to Run a Free Scan for Common PC Errors   [Sponsored Link]

Clear IE7 Browsing History From the Command Line

If you like to build batch files to automate cleanup on your computer, you'll probably want to include at least one of these commands in your batch script. You can automate any one of the functions on the Internet Explorer 7 Delete Browsing History dialog.

Here's the dialog that you are probably used to seeing:

And here's the commands that correspond to the different buttons. The most important one from a cleanup perspective is the first, which will delete just the temporary internet files that are cluttering up your computer. 

To use these commands, just run them from the command line, the start menu search box in vista, or a batch file.

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

 These commands should work in Internet Explorer 7 on XP or on Windows Vista.

The Geek is the founder of How-To Geek and a geek enthusiast. When he's not coming up with great how-to articles, he's probably writing at his personal blog. This article was written on 02/12/07 and tagged with: Windows, Firefox & Internet, Windows Vista, Vista Tips & Tweaks

Comments (15)

  1. Karn

    I add the shortcut "RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 1″. But it can not clear the IE7 history. If i use the dialog "Delete history", the history can be deleted. Why?

  2. JT

    Same here. The 'History' is not deleted, no matter which script I use.

  3. cody

    If I do it from command prompt or start..run..cmd a box pops up and says"Error in InetCpl.cpl
    Missing entry:ClearMyTracksByProcess"
    Anybody know what the hell this means or is?????

  4. tom

    nice i like it . it worked out for me

  5. JT

    The "By Most Visited" History is not erased.

  6. RD

    My history was deleted. using IE7 on Xp Pro

  7. Netsanet

    I am now using the CLI window of /ubuntu.
    I want to use the i nternet on it.Any body can tell me how Iam able to do that

    thanks

  8. Exuroo

    Thanks dude

  9. LMO

    very nice, many thanks finally something that worked

  10. Samson

    I need something like this for IE 6. Would you have any ideas?

  11. TinnyFusion

    Create a standard txt file and add the following lines of code, save as a batch file (.bat rather than .txt) then simply run.

    @ECHO OFF
    ECHO * Cleaning Current User's Temp Folders *
    FOR /D %%G IN ("C:\Documents and Settings\*.*") DO DEL/S/Q/F "%%G\Cookies\*.*"
    FOR /D %%G IN ("C:\Documents and Settings\*.*") DO DEL/S/Q/F "%%G\Local Settings\Temp\*.*"
    FOR /D %%G IN ("C:\Documents and Settings\*.*") DO DEL/S/Q/F "%%G\Local Settings\History\*.*"
    FOR /D %%G IN ("C:\Documents and Settings\*.*") DO DEL/S/Q/F "%%G\Local Settings\Temporary Internet Files\*.*"
    Echo * Done *
    PAUSE
    CLS

  12. eduardo

    does any one know how to delete off line contents from command line? API? inetcpl.cpl? from ie 6.0?

  13. moe

    This worked great for me as well. Now if I could find something similar for IE6. I tried several different things including the batch file posted above by TinnyFusion. They all look like they're deleting files but when I go and check the folders, the cookies and everything else are still there. When I do it from windows, the folder is missing. :( Isn't there a rundll32 type option for ie6?

  14. Silva

    TinnyFusion great stuff . I could simple extend it to clear index.dat and other unwanted files.

  15. Angela

    What about how to delete history (IE7/VISTA) for a user *other* than the current user? Like for an Administrator to delete a user's history.


Leave a Comment




Leave your friendly comment here. If you have a computer help question, leave it on the forums instead.

Note: Your comment may not show up immediately on the site.

Copyright © 2006-2008 HowToGeek.com. All Rights Reserved.