@echo off echo Waiting 30 seconds... rem The following is needed because SET rem treats numbers starting with 0 as rem octal values. rem (thus 08 and 09 are invalid) rem 1- Get second and add single space rem before. set endTime= %time:~-5,2% rem 2- Delete zero after space set endTime=%endTime: 0= % rem 3-Operate rem rem %% is duplicated because this is a rem batch file. Replace with single % rem if typing in the console. rem Also we need spaces around numbers set /A endTime=( %endTime% + 30 ) %% 60 echo %endTime% rem 4-Get zero again for /L %%a in (0;1;9) do if "%endTime%"=="%%a" set endTime=0%%a rem 5- Finally compare with time seconds rem until we have a match. :repeat if %time:~-5,2%.==%endTime%. goto :end goto :repeat :end