Ok.. this should work:

code:
$s=45

$b=75

$log=@scriptdir+"\ajat.log"

CLS

"Running Random beep every $s - $b seconds"

? ?"log is being written to $log"

? "to stop the script press any letter"

$b=$b-$s

run '%comspec% /c echo starting time logging at @time >> "$log"'


srnd(@msecs)

do

$sleep=$s+1+rnd($b-1)

play "0g5000f12d128t5g5000f12d128t"

run '%comspec% /c echo @time >> "$log"' at(5,20) @time

sleep $sleep
until kbhit()

Brian