Cametolose
Cametolose
CC#
Created by Cametolose on 1/25/2023 in #help
❔ Replace many files automatically
Hey, I want to replace hundreds or thousands of files with the same name. The files are saved in different directories. I already got it kinda working, but it don't replace files that are in different directories with the same name. Here is what I already have:
string SourcePath = "Path1";
string DestinationPath = "Path2";
foreach (string path in Directory.GetFiles(SourcePath, "*.*", SearchOption.AllDirectories))
File.Copy(path, path.Replace(SourcePath, DestinationPath), true);
string SourcePath = "Path1";
string DestinationPath = "Path2";
foreach (string path in Directory.GetFiles(SourcePath, "*.*", SearchOption.AllDirectories))
File.Copy(path, path.Replace(SourcePath, DestinationPath), true);
2 replies
CC#
Created by Cametolose on 9/23/2022 in #help
Visual Studio extension does not install
1 replies