How to do looping in Windows Batch

Source from Tine Ivanič We need loops in batch file to prevent writing long blocks of code and to do repetitive process. There are 2 ways to do looping in Windows Batch. Method 1 Use this method for numeric values FOR /L %%A IN (1,1,200) DO (ECHO %%A) where 1,1,200 means start, increment step and end …

How calculate time difference in Windows Batch?

Source from Sonja Langford A small piece of code to determine time difference. Could be useful and integrated to your batch file. @echo off rem Get start time:for /F “tokens=1-4 delims=:.,” %%a in (“%time%”) do (set /A “start=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100”) rem Any process here…TIMEOUT /T 60TIMEOUT /T 1 rem Get end time:for …

Design a site like this with WordPress.com
Get started