Example: Folder 1 has A to Z file name Folder 2 has only V to Z file name
I want to move then replace file in Folder 2 only with same name from file in Folder 1. is there a cmd/script...etc to do this?
Example: Folder 1 has A to Z file name Folder 2 has only V to Z file name
I want to move then replace file in Folder 2 only with same name from file in Folder 1. is there a cmd/script...etc to do this?
We suppose you have only two folders (Folder 1 and Folder 2).
In Folder 2, you have file names which are surely also in Folder 1.
You want to move (overwrite) from Folder 1 to Folder 2 only files with the same name; as a result in Folder 2, you will have the same number of files, while in Folder 1 you will have fewer files because they had to be moved.
In CygWin you can do:
find Folder2 -maxdepth 1 -type f -printf %f\\n | while IFS= read -r filename ; do mv "Folder1/$filename" "Folder2" ; done
For cmd you can do:
for /f "delims=" %f in ('dir /b "Folder2"') do move /y "Folder1\%f" "Folder2"