I am trying to copy thousands of image files listed in a text file from multiple folders to one folder. The script I have works if all the file names were different. How do I get it to rename duplicates or rename all of them? Either will work as the name isn't important.
Example list
G:\research_data\an\an01\DCIM\100MSDCF\DSC04450.JPG
G:\research_data\an\an01\DCIM\100MSDCF\DSC04076.JPG
G:\research_data\an\an01\DCIM\100MSDCF\DSC03141.JPG
G:\research_data\an\an01\DCIM\120MSDCF\DSC04840.JPG
G:\research_data\an\an02\DCIM\100MSDCF\DSC04450.JPG
G:\research_data\an\an02\DCIM\112MSDCF\DSC04076.JPG
G:\research_data\an\an03\DCIM\102MSDCF\DSC03141.JPG
G:\research_data\an\an03\DCIM\105MSDCF\DSC04450.JPG
G:\research_data\an\an03\DCIM\106MSDCF\DSC04076.JPG
code:
@echo off
for /f "tokens=* delims=" %%a in ('type "L:\an_2017\image_list.txt"') do xcopy /hrkvy "%%a" "L:\an_2017"
pause