rem Update the robocopy report file
set "report=c:\scripts\logs\robolog-reports.txt"
robocopy "\\server1\reports" "c:\temp" /LOG+:"%report%"
rem Keep the last N lines in the report
set lines=300
for /F %%a in ('find /C /V "" ^< "%report%"') do set "lastLine=%%a"
if %lastLine% leq %lines% goto :EOF
set /A firstLine=lastLine-lines
more +%firstLine% "%report%" > tempFile.tmp
move /Y tempFile.tmp "%report%"