batch-file Comments in Batch Files Block Comments


The batch file format does not have a block comment syntax, but there is an easy workaround for this.

Normally each line of a batch file is read and then executed by the parser, but a goto statement can be used to jump past a block of plain text (which can be used as a block comment):

@echo off
goto :start

A multi-line comment block can go here.
It can also include special characters such as | >


Since the parser never sees the lines between the goto :start statement and :start label it can contain arbitrary text (including control characters without the need to escape them) and the parser will not throw an error.