i need programmatically delete Internet Explorer 8 History, Cookies, Cache and Passwords
More than that i need to do it silently :-( without any popup window , so I can't use
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 2
coz it's starting the progress window dialog.
I've tried to run this from CreateProcess function with startInfoParams
siStartupInfo.dwFlags = STARTF_USESHOWWINDOW;
siStartupInfo.wShowWindow = SW_HIDE;
but it doesn't helped , coz it seems like Inetcpl.cpl running asynchronious , and starting it's own thread that show the window.
Does anyone know the way to implement this ?
Thanks.
You can use FindFirstUrlCacheEntry()
, FindNextUrlCacheEntry()
, and DeleteUrlCacheEntry()
to remove URLs and files from the Temporary Internet Files cache.
You can use FindFirstUrlCacheEntryEx()
and FindNextUrlCacheEntryEx()
to enumerate Cache, History, and Cookies entries, but DeleteUrlCacheEntry()
only works for Cache entries. I don't know the correct way to delete entries from the History and Cookies. You might be able to just get away with calling DeleteFile()
on the filename reported in the INTERNET_CACHE_ENTRY_INFO
struct, if one is present. Or maybe use InternetSetCookie/Ex()
to overwrite the existing cookie data with a new timestamp that is expired.
I have no clue if it is possible to manipulate the Password list programmably.
You could manually delete all files located in TemporaryInternetFiles and similar directories. Just find out which ones you want deleted. To remove entire, non-empty directories, either use a combination of FindNextFile
/ DeleteFile
/ DeleteDirectory
, or use SHFileOperation
. There's working code on codeguru.