A line that start in double colon represent an invalid label that is ignored by the command processor, so it may be used to insert a comment. For reasons that can't be traced, many people use ::
to insert comments in Batch files, but you must be aware that there are several pitfalls in its use that are described in the link given in Koterpillar's answer. It seems that the first use of ::
instead of REM
command was with the purpose to speed up the execution of Batch files in slow machines (ie: floppy disks), but that reason is not a valid justification for the use of double colon since many years ago.
Any line that contain an invalid label will be ignored by the command processor and you may use practically any special character to generate an invalid label. For example:
@echo off
:~ This is a comment
:` This is a comment
:! This is a comment
:@ This is a comment
:# This is a comment
:$ This is a comment
:% This is a comment
:^ This is a comment
:& This is a comment
:* This is a comment
:( This is a comment
:) This is a comment
:_ This is a comment
:- This is a comment
:+ This is a comment
:= This is a comment
:{ This is a comment
:} This is a comment
:[ This is a comment
:] This is a comment
:| This is a comment
:\ This is a comment
:: This is a comment
:; This is a comment
:" This is a comment
:' This is a comment
:< This is a comment
:> This is a comment
:, This is a comment
:. This is a comment
:? This is a comment
:/ This is a comment
echo OK
In other words: if you want to insert a comment and you want not to use REM
command (although I can't think of any reason to do so), you have 32 possible character combinations to do so. Why you should use precisely this one: ::
? Just because some old programs written 35 years ago did it?