System.IO.DirectoryInfo _dirAA = new System.IO.DirectoryInfo(@"C:\Users\rockymay\Downloads\ROCKY\xx\");
foreach (System.IO.DirectoryInfo _dir in _dirAA.GetDirectories())
{
foreach(var _dir1 in _dir.GetDirectories())
{
foreach (var _dir2 in _dir1.GetDirectories())
{
foreach (var _dir3 in _dir2.GetDirectories())
{
if (_dir3.Name.Contains("[BT-btt.com]"))
{
string _name = _dir3.Name.Replace("[BT-btt.com]", "");
string newpath = _dir2.FullName + "\\" + _name;
System.IO.Directory.Move(_dir3.FullName, newpath);
Console.Write("#");
}
}
}
}
}
// BATCH RENAME FILE
foreach (String filePath in Directory.GetFiles(@"C:\Users\rockymay\Downloads\ROCKY\xx\", "*.*", SearchOption.AllDirectories))
{
File.Move(filePath, filePath.Replace("[BT-btt.com]", ""));
Console.Write("#");
}