Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @ECHO OFF
- :: INSERT VALUES HERE
- SET instances=42
- SET iterations=4
- SET memory=62
- ::ACTUAL SCRIPT
- SET /A x=0
- SET logname=log %date:~-4,4%-%date:~-7,2%-%date:~-10,2% %time:~-11,2%-%time:~-8,2%-%time:~-5,2%
- MD "%logname%">NUL 2>NUL
- :LOOP1
- SET /A x+=1
- IF %x% LEQ %instances% (
- START /B CMD /C memtestG80 %memory% %iterations% ^>"%cd%\%logname%\log%x%p.txt" ^& REN "%cd%\%logname%\log%x%p.txt" "log%x%.txt"
- GOTO :LOOP1
- )
- ECHO Testing...
- :LOOP2
- PING -n 2 127.0.0.1>nul
- SET /A count=0
- FOR %%G in ("%cd%\%logname%\*.txt") DO SET /A count+=1
- IF %count% LSS %Instances% GOTO :LOOP2
- setlocal enabledelayedexpansion
- :LOOP3
- PING -n 2 127.0.0.1>nul
- SET gate=1
- FOR %%F IN ("%cd%\%logname%\*.txt") DO (
- SET parameter=%%F
- IF !parameter:~-5!==p.txt SET gate=0
- )
- IF %gate%==0 GOTO :LOOP3
- endlocal
- setlocal disabledelayedexpansion
- endlocal
- ECHO Test finished. Generating result overview from logs.
- SET /A y=0
- SET resultname="Results %date:~-4,4%-%date:~-7,2%-%date:~-10,2% %time:~-11,2%-%time:~-8,2%-%time:~-5,2%.txt"
- ECHO Test Results >%resultname%
- :LOOP4
- SET /A y+=1
- setlocal enabledelayedexpansion
- SET file="%cd%\%logname%\log%y%.txt"
- FOR /F "delims=" %%A in ('find /C /V "" ^<%file%') DO (
- SET /A offset=%%A -1
- MORE +!offset! <%file% > output.tmp
- )
- endlocal
- setlocal disabledelayedexpansion
- endlocal
- <output.tmp SET /P lastline=
- SET result=%lastline:~-8%
- ECHO Test%y% %result% >>%resultname%
- IF %y% LSS %instances% GOTO :LOOP4
- TYPE nul >output.tmp
- DEL /f /q output.tmp
- ECHO End of batch
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement