To rename a file you actually use the File.Move method of System.IO
to find the files named Maced****** you'l need to loop through your files/directories and check if the name == the name you wanna find.
for example,
Using System.IO;
System.IO.File.Move(oldFileName, newFileName);
string[] array1 = Directory.GetFiles(@"C:\Maced_Jul_2010");
For(int i = 0; i < array1.length; i++)
{
if(array1[i].contains("Maced") {
System.IO.File.Move(array1[i], indexof(0, 5));
}
}
Note:
i just noticed that this will not work - you're going to have the same file name for every file in there - and that will end up falling over.. i think you meant to have the word 'MACED' removed from the filename? in which case, same code except inside the if statement -
System.IO.File.Move(array1[i], indexof(5, array1[i].length - 5));