static void ChangeNameRecursive(DirectoryInfo dir)
{
int i = 0;
foreach(var item in dir.GetFiles())
{
File.Move (item.FullName, $"{name} test_ {i.ToString()} {".pp"}");
i++;
}
foreach(var d in dir.GetDirectories())
{
if(d.Name == "." || d.Name == "..")
{
continue;
}
ChangeNameRecursive(d);
}
}
private readonly string name = @"C:\Путь";
// const PATH = @"C:\Путь";
ChangeNameRecursive(new DirectoryInfo (name));