Hellol,
Batch rules:
A batch viewed as a single command line:
1. An instruction
- set, dir, find, [...]
- if, for, cmd
2. Chained commands & | && || - as point 1 or 3
3. In parentheses: command/lines - as point 1 or 2
Wherein:
1. A single line is read to the end of the line and executed according to the rules "of the command interpreter" immediately after the import.
2. Concatenations are defined as single program parts simultaneously "|" Or successively "& && ||" started. Then treat as point 1.
2. Commands, which are summarized in brackets, are read as line-by-line as a separate program and then passed to the command interpreter (CLI) as one or more lines in the batch.
This part is scrambled line by line like a written and after-averaging batch according to point 1 and point 2.
A variables enclosed in percentages show the content at the time of the first reading of a command line.
B variables included in exclamation marks (use "setlocal enabledelayedexpansion") show the content at the last processing time according to point 1.
C Numeric set statements handle the content (without percentage or exclamation point in the variable name) at the time of the calculation according to the calculation rules. Wherein A or B can also be used to calculate (but behave as A or B).
You can reset a variable at any time of the execution (which runs line by line or after point 1).
However, this is treated according to the aspect A or B or C and processed accordingly.
Each variable can be placed in a for-loop (after all points) into a run variable (use "endlocal" or setlocal "disable delayedexpansion"). Then can be set to Other variables as desired.
PS
you can set from a to b and b to a:
see:
this and
thatPhil