GOTO Command
To change the order of processing command lines in a batch file a system
of labels and conditional and unconditional transfers is used.
Batch file label is any sequence of symbols following a colon. Any
lines after a colon are ignored during direct consecutive processing. For
example: ... echo Hello rem (the following line will be ignored during
processing): :Label ...
Unconditional jump in a batch file is used when the user wants to
change the order of the command lines processing.
This is achieved by using the GOTO command containing a label name as
an argument. Example:
...
:Label
pause Press Ctrl-C to exit, otherwise
GOTO Label
...
Here the execution of the batch file is looped by GOTO command. When
executing PAUSE command the command interpreter asks the user to choose
between suspending execution of the batch file and proceeding with the
cycle.