I have a tree of directories containing files and sometime a copy at the same location. This copy is identified by some string, e.g.
_001, appended to the original file name.
I can list such files at the DOS prompt using:
dir /s *_001.*
for /f "tokens=1,2 delims=_" %i in ('dir /s /b *_*.*') do echo %i_%j
But I don't know if this is possible, likely using the later format, to check whether the original file exists and in this case delete the copy.