Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- setlocal
- set file="Telerik Test Studio Trace Log.txt"
- set maxbytesize=104857600
- :loop
- echo "starting file size check"
- for /f "delims=" %%A in (%file%) do set "size=%%~zA"
- if %size% LSS %maxbytesize% (
- echo.File is ^< %maxbytesize% bytes
- ::ping for 5 mins to not run this 1 million times
- ping localhost -n 301 > nul
- goto loop
- ) else (
- echo.File is ^>= %maxbytesize% bytes
- echo y| cacls %file% /g everyone:f
- ren %file% "Telerik logs - %date:/=-% %time::=%.txt"
- move /y *.txt C:\Archive
- :: Timeout to regen the log file
- ping localhost -n 20 > nul
- set file="Telerik Test Studio Trace Log.txt"
- ping localhost -n 301 > nul
- goto loop
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement