Advertisement
Guest User

Untitled

a guest
Aug 27th, 2015
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. @echo off
  2. setlocal
  3. set file="Telerik Test Studio Trace Log.txt"
  4. set maxbytesize=104857600
  5.  
  6. :loop
  7. echo "starting file size check"
  8. for /f "delims=" %%A in (%file%) do set "size=%%~zA"
  9.  
  10. if %size% LSS %maxbytesize% (
  11. echo.File is ^< %maxbytesize% bytes
  12. ::ping for 5 mins to not run this 1 million times
  13. ping localhost -n 301 > nul
  14. goto loop
  15. ) else (
  16. echo.File is ^>= %maxbytesize% bytes
  17. echo y| cacls %file% /g everyone:f
  18. ren %file% "Telerik logs - %date:/=-% %time::=%.txt"
  19. move /y *.txt C:\Archive
  20. :: Timeout to regen the log file
  21. ping localhost -n 20 > nul
  22. set file="Telerik Test Studio Trace Log.txt"
  23. ping localhost -n 301 > nul
  24. goto loop
  25. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement