@Echo Off Set max=20 :begin Set sum=0 For %%i In (*.*) Do Set /a sum+=1 echo files %sum% if /i %sum% GEQ %max% goto start timeout /t 10 goto begin :start echo start action Pause