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

  • comentario

    Text that is ignored when the script runs.

  • ::

    Alternative and common way to write a comment.

  • @rem

    With @ in front it prevents the line from being shown when echo is on.

Usage examples

  • rem Copia de seguridad diaria

    Explanatory comment in a script.

  • :: Otra forma de comentar

    Shorter alternative.

  • @echo off & rem Silencia las órdenes

    Combines 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.

Related commands