tools:batch
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
tools:batch [2024/06/03 07:20] – Humphrey Boa-Gart | tools:batch [2024/08/06 05:48] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 191: | Line 191: | ||
Basically a FOR LOOP declares a variable (%%A) and assigns it different values as it goes through the predefined set of values(abc, def, xyz) and each time the variable is assigned a new value, the FOR loop performs a command.(ECHO %%A) | Basically a FOR LOOP declares a variable (%%A) and assigns it different values as it goes through the predefined set of values(abc, def, xyz) and each time the variable is assigned a new value, the FOR loop performs a command.(ECHO %%A) | ||
- | The %%A is the variable which is assigned different values as the loop goes through the predefined set of values in the brackets. You can use any single letter character after the two % sign except 0 through 9.We use two %'s as DOS deletes each occurrence of a single % sign in a batch file program. | + | The < |
The IN(abc, def, xyz) is the list through which the FOR loop goes. The variable %%a is assigned the various values within the brackets, as the loop moves. The items in the set(The technical term for the set of values within the brackets) can be separated with commas, colons or simply spaces. | The IN(abc, def, xyz) is the list through which the FOR loop goes. The variable %%a is assigned the various values within the brackets, as the loop moves. The items in the set(The technical term for the set of values within the brackets) can be separated with commas, colons or simply spaces. | ||
- | For each item in the set(The IN Thing) the FOR loop performs whatever command is given after the DO keyword.(In this example the loop will ECHO %%A) | + | For each item in the set(The IN Thing) the FOR loop performs whatever command is given after the DO keyword.(In this example the loop will ECHO < |
So basically when we execute the above batch file, the output will be: | So basically when we execute the above batch file, the output will be: |
tools/batch.1717399230.txt.gz · Last modified: 2024/08/06 05:52 (external edit)
Find this page online at: https://bestpoint.institute/tools/batch
Find this page online at: https://bestpoint.institute/tools/batch