This tutorial explains adding comments in dos and batch programming.

There are two ways to comments in Batch programming

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

How to add comments in Bash command files

REM is an remark command that always starts with REM followed by comments.

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

Here is an example

REM Comment example
echo printed to console


echo print1 to console & REM. Inlinecomment & echo print2 to console

using double colons

:: This is also a comment
echo comment

another use percent signs that starts with %= and comment text followed by =%

set "name=john"     %= inline comments=%