Tutorial by Examples

REM This is a comment REM is the official comment command.
::This is a label that acts as a comment The double-colon :: comment shown above is not documented as being a comment command, but it is a special case of a label that acts as a comment. Caution: when labels are used as comments within a bracketed code block or for command, the command processor...
It is also possible to use variables as comments. This can be useful to conditionally prevent commands being executed: @echo off setlocal if /i "%~1"=="update" (set _skip=) Else (set _skip=REM) %_skip% copy update.dat %_skip% echo Update applied ... When using the ab...
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 ...
To comment on the same line as the code you can use &:: or &rem. You can also use && or || to replace &. Example : @echo off echo This is a test &::This is a comment echo This is another test &rem This is another comment pause A curiosity: SET command allows limit...
<!-- : Comment This works with both batch script and WSF. The closing tag(-->), only works in WSF. CodeSucessful in both batch and WSF?<!--: CommentTrue<!--: Comment -->False - The closing tag only works for WSF-->False

Page 1 of 1