rem
Windows CMD · Terminal · reference only
What it does
Marks the rest of the line as a comment in a .bat script, which is neither run nor shown.
Syntax
rem [comentario]
Options and parameters
comentarioText that is ignored when the script runs.
::Alternative and common way to write a comment.
@remWith @ in front it prevents the line from being shown when echo is on.
Usage examples
rem Copia de seguridad diariaExplanatory comment in a script.
:: Otra forma de comentarShorter alternative.
@echo off & rem Silencia las órdenesCombines a comment and echo off on a single line.
Notes and common mistakes
- :: can cause problems inside parenthesized blocks or loops: use rem in those cases.
- An empty rem can be used as a section separator line.