Click here to Skip to main content
15,888,454 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have code at C# that deletes explorer cache files.
it works on all explorer versions < 10

the code looks like this one, only converted to C#.

Does any body knows how to do it for explorer 10?



code like this doesn't works
C#
string path = Environment.GetFolderPath(Environment.SpecialFolder.InternetCache);
System.IO.DirectoryInfo di = new System.IO.DirectoryInfo(path);
KillProcess("iexplore");
di.Attributes = System.IO.FileAttributes.Normal;
foreach (System.IO.FileInfo fi in di.GetFiles())
{
	try
	{
		fi.Delete();
	}
	catch { }
}
foreach (System.IO.DirectoryInfo dir in di.GetDirectories())
{
	try
	{
		dir.Delete(true);
	}
	catch { }
}   
Posted
Comments
Sergey Alexandrovich Kryukov 19-Jun-13 9:05am    
Did you try to run it as administrator? No, not by login on as administrator, by getting elevated privileges?
—SA

1 solution

never mind i found solution

commands from here

just run it from System.Diagnostics.Process and the cache files are gone.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900