title: how to copy only modified files using LogFile.txt?
body: <p>when it comes to creating a batch-file I would sadly call myself a newbie and therefore it's kind of difficult for me to achieve what I want on my own:</p>
  <p>so here is how my codes look:</p>
  <pre><code>@ECHO OFF
  
  for /r &quot;C:\source&quot; %%f in (*) do copy /y &quot;%%f&quot; C:\ReadyToExport
  
  del C:\ReadyToExport\*.pdf*
  
  for /f &quot;delims=&quot; %%i in ('xcopy &quot;C:\ReadyToExport&quot; C:\import /EXCLUDE:LogFile.log /S /E /D') do (
      echo %%i &gt;&gt; C:\LogFile.log)
  
  
  PAUSE
  </code></pre>
  <p>and here is what the code exactly does</p>
  <p>1- <code>for /r &quot;C:\source&quot; %%f in (*) do copy /y &quot;%%f&quot; C:\ReadyToExport</code></p>
  <p>this line copies all files from source to another target folder the good thing is that this command copies all the files inside other subfolders from source and paste them into the folder C:\ReadyToExport without any subfolders.</p>
  <p>2- <code>del C:\ReadyToExport\*.pdf*</code></p>
  <p>this command filters all the .pdf files because they are unnecessary</p>
  <p>3-</p>
  <pre><code>for /f &quot;delims=&quot; %%i in ('xcopy &quot;C:\ReadyToExport&quot; C:\import /EXCLUDE:LogFile.log /S /E /D') do (
          echo %%i &gt;&gt; C:\LogFile.log)
  </code></pre>
  <p>this command basically copies all files from &quot;C:\ReadyToExport&quot; into C:\import and writes the name of the recorded file in LogFile.log then the copied files will be excluded when the script runs again because I don't want to copy the files again if I already copied them before</p>
  <hr />
  <p>and here is what I want to achieve:
  I want to copy only modified files from the folder &quot;C:\ReadyToExport&quot; to the target C:\import but keep in mind that
  the files in the target folder &quot;C:\import&quot; will be deleted but since the names of the files that have already been copied are registered in LogFile.log the files will be excluded and not copied again.</p>
  <p>in another word: files in target file do not exist anymore but their names are written in LogFile</p>
  <p>so is there any way to copy only modified ones? even though they don't exist in the target folder anymore? but their names are in LogFile.txt? can the script somehow write the last modified date in LogFile.txt near the file name? and then compare the date from the source? so it copies only files that have been changed and ignore all files that didn't?</p>
  <p>p.s: using Xcopy, robocopy, etc is not a problem
  any answer will be appreciated.</p>
  <p>thnx</p>