Renaming files in folder c#

You can try with this code

DirectoryInfo d = new DirectoryInfo(@"C:\DirectoryToAccess");
FileInfo[] infos = d.GetFiles();
foreach(FileInfo f in infos)
{
    File.Move(f.FullName, f.FullName.Replace("abc_","")); // Careful!! This will replaces the text "abc_" anywhere in the path, including directory names.
}

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)