title: Copy files which do not exist in log file to folder
body: <p>Essentially I need to be able to copy new files from the source folder which were not present the last time the script ran to a destination folder.</p>
  
  <p>Here is what I am thinking:</p>
  
  <p>-Script to run every 1 min
  -Source Folder
  -Destination Folder
  -Log file records file which was copied</p>
  
  <p>Process:</p>
  
  <p>-Run through directory file by file and check against log file to determine if file needs to be copied. </p>
  
  <p>-If file exists in log file DO NOT COPY</p>
  
  <p>-If file DOES NOT EXIST in log file, Copy to Destination Folder, Write filepath/filename to logfile</p>
  
  <p>-Continue to next file in directory</p>
  
  <p>This is what I have but am experiencing issues with findstr and not entirely sure this is the best way to go about it. </p>
  
  <pre><code>@echo off
  :start
  
  for /r "C:\Source" %%i in (*) do (
  
      echo --------------------------------------
      echo Searching for: %%i
      type log.txt | findstr /L "%%i"
  
      if %ERRORLEVEL% EQU 1 ( 
      echo NOT FOUND
      goto copyfile 
      )
      if %ERRORLEVEL% EQU 0 ( 
          echo FOUND
      )
  echo ------------------------------------------
  
  :copyfile 
  echo ------------------------------------------------------------------
  echo Copy %%i
  copy "%%i" C:\Destination
  echo Writing to log file: %%i
  echo -------------------------------------------------------------------
  echo %%i &gt;&gt; log.txt
  
  )
  </code></pre>
  
  <p>I would greatly appreciate the insight. Thank you all for your time. </p>