goto
Directs cmd.exe to a labeled line in a batch program. Windows commands reference
On Windows
Windows
Directs cmd.exe to a labeled line in a batch program. Within a batch program, this command directs command processing to a line that is identified by a label. When the label is found, processing continues starting with the commands that begin on the next line.
goto <label>
The following batch program formats a disk in drive A as a system disk. If the operation is successful, the goto command directs processing to the :end label
echo off
format a: /s
if not errorlevel 1 goto end
echo An error occurred during formatting.
:end
echo End of batch program.Identify<label>Specifies a text string that is used as a label in the batch program./?Displays help at the command prompt.