How To write a Batch Program using For through numbers
FOR THROUGH NUMBERS
Purpose:Runs a specified command for each file in a set of files.
Syntax:For /L %% variable in (Start#,Step#,End#) do Command [Command Parameter]
Example:
@echo off
For /L %%A in (0,4,20) do echo %%A
In this command, we specified a start value of 0, a step value of 4, and an end value of
20. When this command is executed, the %%A variable takes the values of 0, 4, 8, 12, 16,
and 20, and the Echo command is executed for each of these values.
OutPut:
0
4
8
12
16
20
Comments
Post a Comment