title: batch file to copy a list of files from a text file
body: <p>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.</p>
  
  <p>The text list is in the desktop.</p>
  
  <p>list.txt</p>
  
  <p>and contains, for example,</p>
  
  <p>C:\Users...\Desktop\Test\item1.ipt<BR>
  C:\Users...\Desktop\Test\item2.ipt<BR>
  C:\Users...\Desktop\Test\item3.ipt<BR>
  C:\Users...\Desktop\Test\item4.ipt<BR>
  C:\Users...\Desktop\Test\item5.ipt<BR>
  C:\Users...\Desktop\Test\item6.ipt<BR></p>
  
  <p>and my batch file is also in the desktop.</p>
  
  <pre><code>@echo off 
  FOR /F "delims=" %%a IN (C:\Users\...\Desktop\list.txt) DO COPY "%%~a" "C:\Users\...\Desktop\Temp\%%~nxa"
  </code></pre>
  
  <p>Both files (batch and txt) are in the desktop, so can I delete the path of the text file?</p>
  
  <pre><code>@echo off 
  FOR /F "delims=" %%a IN (list.txt) DO COPY "%%~a" "C:\Users\...\Desktop\Temp\%%~nxa"
  </code></pre>
  
  <p>Thanks for your help.</p>
  
  <p>EDIT: The ideia is to get the file location in the text file, so directories in the text file are variables.</p>