title: How do i make a new logfile for everytime i run the batch file rather than having it append into the same logfile for every run?
body: <pre><code>@echo off
  setlocal
  set SourceFolder=Sourcefolder
  set ArchiveFolder=Archivefolder
  set Age=30
  set FileMask=*.*
  set LogFile=C:\Users\attjung1\Documents\result.log
  &gt;&gt;&quot;%LogFile%&quot; echo ===== Archive job started: %Date% %Time% 
  ==========================
  &gt;&gt;&quot;%LogFile%&quot; echo ===== Moving files older than %Age% days.
  robocopy.exe &quot;%SourceFolder%&quot; &quot;%ArchiveFolder%&quot; /s /MOVE /minage:%Age% /r:0
  /w:0 /tee /np /log+:&quot;%LogFile%&quot;
  &gt;&gt;&quot;%LogFile%&quot; echo =====Archive job done&quot; %Date% %Time% 
  ===============================  
  </code></pre>
  <p>This is my current batchfile code, and all the information is currently being appended into one log file, would like a new log file to be generated for every run of the batch file, please assist</p>