For loop with Delims in Batch Script
Channel: Techno Puffin
Date: 2021-04-30

Go and check out course on Udemy for PowerShell:
https://www.udemy.com/course/powershell-for-beginners-master-the-concepts-step-by-step
****************************************************************************************

The ‘for’ statement also has the ability to move through a range of values. Following is the general form of the statement.

Syntax
FOR /L %%variable IN (Lower ,Increment, Upper) DO your_code
Where

The /L switch is used to denote that the loop is used for iterating through ranges.

Variable declaration – This step is executed only once for the entire loop and used to declare any variables which will be used within the loop. In Batch Script, the variable declaration is done with the %% at the beginning of the variable name.

The IN list contains of 3 values. The Lower , the increment, and the Upper. So, the loop would start with the Lower and move to the Upper value, iterating each time by the Increment value.

The your_code code block is what needs to be executed for each iteration.