I'm trying to make a batch file to copy files from a text list to a folder. The code was copied in this forum but it doesn't work.
The text list is in the desktop.
list.txt
and contains, for example,
C:\Users...\Desktop\Test\item1.ipt
C:\Users...\Desktop\Test\item2.ipt
C:\Users...\Desktop\Test\item3.ipt
C:\Users...\Desktop\Test\item4.ipt
C:\Users...\Desktop\Test\item5.ipt
C:\Users...\Desktop\Test\item6.ipt
and my batch file is also in the desktop.
@echo off
FOR /F "delims=" %%a IN (C:\Users\...\Desktop\list.txt) DO COPY "%%~a" "C:\Users\...\Desktop\Temp\%%~nxa"
Both files (batch and txt) are in the desktop, so can I delete the path of the text file?
@echo off
FOR /F "delims=" %%a IN (list.txt) DO COPY "%%~a" "C:\Users\...\Desktop\Temp\%%~nxa"
Thanks for your help.
EDIT: The ideia is to get the file location in the text file, so directories in the text file are variables.