@echo off setlocal enabledelayedexpansion :: It's easier and neater to create the variables holding the random 4 digit numbers ahead of time for /l %%i in (1,1,12) do set /a rand%%i=!random! %% 9999 :: The command output of everything within the brackets is sent to the file "table.html", overwriting anything already in there ( echo ^^^^ echo ^ echo ^^^ echo ^X^ echo ^Y^ echo ^Z^ echo ^ echo ^^1^ echo ^
%rand1%^ echo ^%rand2%^ echo ^%rand3%^ echo ^ echo ^^2^ echo ^%rand4%^ echo ^%rand5%^ echo ^%rand6%^ echo ^ echo ^^3^ echo ^%rand7%^ echo ^%rand8%^ echo ^%rand9%^ echo ^ echo ^^4^ echo ^%rand10%^ echo ^%rand11%^ echo ^%rand12%^ echo ^ echo ^ echo ^^ ) > table.html start table.html