Dos - Label (Line)


Grammar - Label statement in DOS.

A label is a place-holder in a batch script

The name “label” is also a DOS command to creates, changes, or deletes the volume label of a disk.

The label must be at the beginning of a line with a colon.

It can be called via:

  • the goto command inside the script
  • the call command between two scripts


@echo off

Goto myLabel
echo Do I see this ?

:: The label myLabel
echo No You will see this


No You will see this



If Command Extensions are enabled, GOTO command now accepts a target label of :EOF which transfers control to the end of the current batch script file.

This is an easy way to exit a batch script file without defining a label. More see the call help.

Powered by ComboStrap