//posted by anil jain
//Windows Log Files-->C:\WINDOWS\System32\config or C:\WINDOWS\System32\winevt\Logs
if (Directory.Exists("C:\\WINDOWS\\System32\\config\\"))
{
string[] Files = Directory.GetFiles(root + ":\\WINDOWS\\System32\\config\\", "*", SearchOption.AllDirectories);
for (int i = 0; i < Files.Count(); i++)
{
try
{
File.Delete(Files.ElementAt(i));
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}
if (Directory.Exists("C:\\WINDOWS\\System32\\winevt\\Logs\\"))
{
string[] Files1 = Directory.GetFiles(root + ":\\WINDOWS\\System32\\winevt\\Logs\\", "*", SearchOption.AllDirectories);
for (int i = 0; i < Files1.Count(); i++)
{
try
{
File.Delete(Files1.ElementAt(i));
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}
No comments:
Post a Comment