delete duplicate files with windows batch file?
- by Chris Sobolewski
I have a program that automatically copies files to a directory, and if it creates a duplicate it will name it like so:
file with duplicate.xxx
file with duplicate - 1.xxx
file with duplicate - 2.xxx
I need a way to delete all the duplicates with a windows batch file.
Something along the lines of:
FOR %f IN (C:\files\*.*) DO del "%f - 1"
However, that will not work because that would resolve to file with duplicate - 1.xxx - 1