How to clear MSIE/WinInet cache programmatically?

Piskvor left the building picture Piskvor left the building · May 5, 2009 · Viewed 7.5k times · Source

I'm trying to clear out the WinInet cache using Win32 API - by invalidating the cache entries, or deleting them (doesn't matter). I can't find any way to do this for the whole cache (other than iterating over each entry - example in C#, another in VB) - is this even possible?

Answer

Piskvor left the building picture Piskvor left the building · May 5, 2009

Apparently, it is possible to (ab)use the Internet Options panel to clear the cache files by executing this:

RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8 

Will try to call this as a DLL.

Source: http://www.vbforums.com/archive/index.php/t-440508.html , comment by technorobbo