none
How to clear IE cache in Windows 7 programmatically?

    Question

  • When in Windows XP,we can use the winet API FindFirstUrlCacheEntry, FindNextUrlCacheEntry, DeleteUrlCacheEntry to delete the IE cache.

    But it doesn't work in Windows 7.

    How to clear IE cache in Windows 7 programmatically?  Is there any windows API to perform it?

    Thanks a lot.

    Wednesday, November 17, 2010 10:46 AM

Answers

  • Hi,

    Did you use IE 8? Can you delete these IE temporary internet files manually?

     

    Please set your IE location first:

    1 Open IE

    2 Click “Tools”

    3 Click “Internet Options”

    4 Go to “General\Browsing history” then click “Settings”

    5 Click “Move folder” and set current location to “C:\Users\<user>\AppData\Local\Microsoft\Windows\Temporary Internet Files\”

    6 Click “OK”

     

    Then use command “RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8” to see the result.

     

    Hope it works.

     

    Regards,

    Leo   Huang


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    Monday, November 29, 2010 1:21 AM
    Moderator

All replies

  • Hi,

    After I have checked on Windows 7 Compatibility Center, I found that winet API is not compatible with Windows 7. You can check it on:

    http://www.microsoft.com/windows/compatibility/windows-7/en-us/Search.aspx?l=en-us&type=Software&s=winet%20API%20

     

    And we do not recommend user use third-party tools to delete IE cache, it may cause unexpected issue.

     

    But based on my experience, you can create a bat file with DOS command with these steps below:

    1 Create a txt file

    2 Open the file and input these commands:

    RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8

    RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 2

    RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 16

    RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 32

    3 Save the file, and change the extension to .bat

     

    Note: 8 is for Temporary Internet Files, 2 is for Cookies, 16 is for Form Data and 32 is for Passwords

     

    Thus, when you want to clean IE cache, you just run the bat file.

     

    Hope it works.

     

    Regards,

    Leo   Huang


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    Friday, November 19, 2010 7:21 AM
    Moderator
  • Hi,

    After I have checked on Windows 7 Compatibility Center, I found that winet API is not compatible with Windows 7. You can check it on:

    http://www.microsoft.com/windows/compatibility/windows-7/en-us/Search.aspx?l=en-us&type=Software&s=winet%20API%20

     

    And we do not recommend user use third-party tools to delete IE cache, it may cause unexpected issue.

     

    But based on my experience, you can create a bat file with DOS command with these steps below:

    1 Create a txt file

    2 Open the file and input these commands:

    RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8

    RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 2

    RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 16

    RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 32

    3 Save the file, and change the extension to .bat

     

    Note: 8 is for Temporary Internet Files, 2 is for Cookies, 16 is for Form Data and 32 is for Passwords

     

    Thus, when you want to clean IE cache, you just run the bat file.

     

    Hope it works.

     

    Regards,

    Leo   Huang


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.


    I tried it in win 7 as you suggest, but found it didn't work.(I ran the bat file in administrator)

    Is there any other method?

    Monday, November 22, 2010 3:40 AM
  • Hi,

    Did you get any error message when you run this bat file? As I have tested on my machine, it works well. It will delete IE temporary internet files, cookies, form date and passwords.

     

    Regards,

    Leo   Huang


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    Monday, November 22, 2010 5:06 AM
    Moderator
  • hi,

    I didn't get any error message. And It seems that it was done successfully, but IE temporary internet files were still there. The IE cache files in C:\Users\<user>\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.IE5\*

    can't be deleted.

    Regards,

    Rain Lee


    Wednesday, November 24, 2010 3:09 AM
  • Hi,

    RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8

    This command is delete IE temporary internet files

     

    Please just run this command and see the result.

     

    Hope it helps.

     

    Regards,

    Leo   Huang


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    Wednesday, November 24, 2010 9:25 AM
    Moderator
  • Hi,

    I did as you told, using

    RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8”only, but IE temporary internet files were still there. The IE cache files in C:\Users\<user>\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.IE5\* can't be deleted.
    Saturday, November 27, 2010 8:26 AM
  • Hi,

    Did you use IE 8? Can you delete these IE temporary internet files manually?

     

    Please set your IE location first:

    1 Open IE

    2 Click “Tools”

    3 Click “Internet Options”

    4 Go to “General\Browsing history” then click “Settings”

    5 Click “Move folder” and set current location to “C:\Users\<user>\AppData\Local\Microsoft\Windows\Temporary Internet Files\”

    6 Click “OK”

     

    Then use command “RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8” to see the result.

     

    Hope it works.

     

    Regards,

    Leo   Huang


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    Monday, November 29, 2010 1:21 AM
    Moderator
  • Thanks for your answer.

    But when i checked my IE setting, found that the IE temporay current location is “C:\Users<user>\AppData\Local\Microsoft\Windows\Temporary Internet Files\” already, so the method of using command “RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8” doesn't work in my computer.

    Monday, December 06, 2010 3:47 AM
  • Thant’s quite strange, can you delete this folder manually?

     

    Please try the following steps:

     

    Running IE with NO add-ons:

    Click Start, input Internet Explorer (No Add-ons) into Start Search box and press Enter. Change the cookie settings and have a test.

     

    If the issue persists, you can reset IE as below:

     

    And reset IE:

    1) Open Internet Explorer.

    2) Click Tools--- Internet Options.

    3) On the Security tab, click Default level button for each icon in the Select a zone to view or change security settings.

    4) Click to Programs tab, and then click the Make default button if it is not grayed out.

    5) Click to Advanced tab, click Restore advanced settings button in the Settings area.

    6) Click the Reset button in the Reset Internet Explorer settings area and Click OK.

    7) Click Apply, and then click OK.

     

    Hope it helps.

     

     

    Regards,

    Leo   Huang


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    Tuesday, December 07, 2010 1:25 AM
    Moderator