I have a simple batch script that is looping through a directory of PDF files and copying the files to a destination folder that are identified in a list file. Everything is working fine, however I want to rename the file that is copied to the destination. If I am searching for 100 files, I want to destination files to be named in increment of search (i.e., 0001.pdf, 0002.pdf, 0003.pdf, etc.).
for /f %%X in (%FIILELIST%) do call :COPY_FILES "%%X"
for /r %FILESPATH% %%I in (%~1) do xcopy /qvs "%%I" "%DESTPATH%%%~pnxI"
Any help would be appreciated.