http://hwspirit.com/forum/viewtopic.php?t=135
posted by Bloody
We've prepared a simple batch (.bat) file that can turn Quake 4 into a great PC hardware stress test.
@echo off
set /a loopcount = 0
IF NOT EXIST quake4.exe GOTO ERROR2
IF NOT EXIST .\q4base\demos\%1.demo GOTO ERROR3
IF "%1%" == "" GOTO ERROR1
echo ------------------------------
echo HWspirit.com Quake 4 demo loop
echo ------------------------------
:LOOP
set /a loopcount = loopcount + 1
echo Running loop number %loopcount%
quake4.exe +set logfile 1 +timedemoquit %1.demo
for /f "tokens=1*" %%a in ('findstr /R /C:"frames rendered in .* seconds =" .\q4base\qconsole.log') do echo Demo loop %loopcount%: %%a %%b >> results.txt
GOTO LOOP
:ERROR1
echo ------------------------------
echo HWspirit.com Quake 4 demo loop
echo ------------------------------
echo You have to type the name of the demo file you want to be looped
echo Running the loop.bat file for instance with: loop hwspirit
echo will run an indefinite loop of the timedemo hwspirit.demo
echo Note: do not type .demo after the name of the demofile!
GOTO END
:ERROR2
echo ------------------------------
echo HWspirit.com Quake 4 demo loop
echo ------------------------------
echo You must place this file in the same
echo folder where you've installed Quake 4!
GOTO END
:ERROR3
echo ------------------------------
echo HWspirit.com Quake 4 demo loop
echo ------------------------------
echo The demo file you have specified: %1.demo
echo doesn't exist in the demos folder!
:END
read the rest at his site.