Tuesday, February 2, 2010

ChkDsk File Fragments in windows XP

//Posted By anil jain

string[] Files=Directory.GetFiles(root + ":\\Program Files\\","*.chk",SearchOption.AllDirectories);
for (int i = 0; i < Files.Count(); i++)
{
try
{
File.Delete(Files.ElementAt(i));
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
string[] Files1 = Directory.GetFiles(root + ":\\Windows\\", "*.chk", SearchOption.AllDirectories);
for (int i = 0; i < Files1.Count(); i++)
{
try
{
File.Delete(Files1.ElementAt(i));
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}

1 comment: