Поделиться через


rem

Записывает примечания в скрипт, пакет или файл config.sys. If no comment is specified, rem adds vertical spacing.

Note

Эта команда является внутренней для интерпретатора командной строки cmd.exe.

Syntax

rem [<comment>]

Parameters

Parameter Description
<comment> Указывает строку символов, включаемых в качестве комментария.
/? Отображает справку в командной строке.

Remarks

  • The rem command doesn't display comments on the screen. To display comments on the screen, you must include the echo on command in your file.

  • Нельзя использовать символ перенаправления (< или >) или канал (|) в примечании пакетного файла.

  • Although you can use rem without a comment to add vertical spacing to a batch file, you can also use blank lines. Пустые строки игнорируются при обработке пакетной программы.

Examples

Чтобы добавить вертикальный интервал с помощью примечаний пакетного файла, введите следующее:

@echo off
rem  This batch program formats and checks new disks.
rem  It is named Checknew.bat.
rem
rem echo Insert new disk in Drive B.
pause
format b: /v chkdsk b:

To include an explanatory comment before the prompt command in a config.sys file, type:

rem Set prompt to indicate current directory
prompt $p$g

Чтобы указать комментарий о выполнении скрипта, введите следующее:

rem The commands in this script set up 3 drives.
rem The first drive is a primary partition and is
rem assigned the letter D. The second and third drives
rem are logical partitions, and are assigned letters
rem E and F.
create partition primary size=2048
assign d:
create partition extended
create partition logical size=2048
assign e:
create partition logical
assign f:

Для многостроковых комментариев используйте условное выполнение:

  Rem/||(
    The REM statement evaluates to success,
    so these lines will never be executed.
    Keep in mind that you will need to escape closing parentheses
    within multi-line comment blocks like shown in this example. ^)
  )