Purpose:Put a comment in a batch file


Format:REM [comment ]


commentThe text to include in the batch file.


See also: COMMENT.




The REM command lets you place a remark or comment in a batch file. Batch file comments are useful for documenting the purpose of a batch file and the procedures you have used. For example:


rem This batch file provides a

rem menu-based system for accessing

rem word processing utilities.


rem Clear the screen and get selection



REM must be followed by a space or tab character, then the comment. TCC-RT will ignore everything on the line following the REM, including quotes, redirection symbols, and other commands (see below for the exception to this rule).


If ECHO is ON, the comment is displayed. Otherwise, it is ignored. If ECHO is ON and you don't want to display the line, preface the REM command with an at sign [@].


You can also place a comment in a batch file by starting the comment line with two colons [::]. In essence this creates a batch file "label" without a valid label name.


You can use REM to create a zero-byte file if you use a redirection symbol immediately after the REM command. For example, to create the zero-byte file C:\xyz:




(This capability is included for compatibility with CMD. A simpler method for creating a zero-byte file with TCC-RT is to use >filename as a command, with no actual command before the [>] redirection character.)