How to clear IE cache in Windows 7 programmatically?
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.
November 17th, 2010 5:51am
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 HuangPlease 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.
Free Windows Admin Tool Kit Click here and download it now
November 19th, 2010 2:28am
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?
November 21st, 2010 10:41pm
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
HuangPlease 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.
Free Windows Admin Tool Kit Click here and download it now
November 22nd, 2010 12:07am
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
November 23rd, 2010 10:10pm
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
HuangPlease 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.
Free Windows Admin Tool Kit Click here and download it now
November 24th, 2010 4:27am
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.
November 27th, 2010 3:27am
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
HuangPlease 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.
Free Windows Admin Tool Kit Click here and download it now
November 28th, 2010 8:22pm
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.
December 5th, 2010 10:48pm
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
HuangPlease 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.
Free Windows Admin Tool Kit Click here and download it now
December 6th, 2010 8:26pm