Solved batch file count else sleep 10 minutes and loop

June 4, 2012 at 22:05:05
Specs: Windows 7
Need to create a batch file which count files in a folder, exit if >=10 else wait 10minute and recount.

thanks,
KC


See More: batch file count else sleep 10 minutes and loop

Report •

#1
June 4, 2012 at 22:56:33
✔ Best Answer
:: ===== script starts here ===============
::
:: kc188.bat Tue 05-06-2012 12:38:06.07
@echo off & setLocal enableDELAYedeXpansioN

:loop
set N=
for /f "tokens=* delims= " %%a in ('dir/b/a-d') do (
set /a N+=1
if !N! geq 10 goto :done
)
ping -n 1 -w 600000 1.1.1 > nul
echo !N!
goto :loop

:done
echo !N!
goto :eof

::====== script ends here =================


=====================================
Life is too important to be taken seriously.

M2


Report •

#2
June 4, 2012 at 23:55:04
Work's like a charm! Thank you very Much M2Go!

Report •
Related Solutions


Ask Question