Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Programmatically clear IE history, cookies, cache while IE is open

If I have an instance of IE open, with access to the underlying COM objects (IWebBrowser2 etc...) can I programmatically clear out all of the history, cookies and cached data?

Is there a way to do it in both private mode and non private mode without closing the browser and reopening it?

I have tried spawning rundll32.exe inetcpl.cpl,ClearMyTracksByProcess 1023 with various combinations of the bit flags passed as arguments, but it only seems to work when the browser is closed, and I need a solution that allows the browser to stay open.

like image 604
tt9 Avatar asked Oct 18 '22 10:10

tt9


1 Answers

Caching is done by wininet, not mshtml.

There are good samples of this at: https://msdn.microsoft.com/en-us/library/aa383928(VS.85).aspx

like image 173
user6338641 Avatar answered Oct 27 '22 22:10

user6338641