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 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 useSHFileOperation
. There's working code on codeguru.You can use
FindFirstUrlCacheEntry()
,FindNextUrlCacheEntry()
, andDeleteUrlCacheEntry()
to remove URLs and files from the Temporary Internet Files cache.You can use
FindFirstUrlCacheEntryEx()
andFindNextUrlCacheEntryEx()
to enumerate Cache, History, and Cookies entries, butDeleteUrlCacheEntry()
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 callingDeleteFile()
on the filename reported in theINTERNET_CACHE_ENTRY_INFO
struct, if one is present. Or maybe useInternetSetCookie/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.