This tutorial explains adding comments in dos and batch programming.

There are two ways to comment on Batch programming.

  • Use REM
  • double colon(::)
  • %= comment =%

How to add comments in Bash command files

  • REM REM is a remark command that always starts with REM followed by comment text.

With REM, We can add single and inline comments as seen below.

Here is an example of Single and Inline Comments

REM Comment example
echo printed to console


echo print1 to console & REM. Inlinecomment & echo print2 to console
  • using double colons Another way Place double colons at the line start followed by a comment string in a line.
:: This is also a comment
echo comment
  • use %= The third way, use percent signs that start with %= and comment text followed by =%.
set "name=john"     %= inline comments=%