次の方法で共有


rem

スクリプト、バッチ、または config.sys ファイルにコメントを記録します。 コメントが指定されていない場合、 rem は垂直方向の間隔を追加します。

Note

このコマンドは、コマンド ライン インタープリターの内部 cmd.exe。

Syntax

rem [<comment>]

Parameters

Parameter Description
<comment> コメントとして含める文字の文字列を指定します。
/? コマンド プロンプトにヘルプを表示します。

Remarks

  • rem コマンドは、画面にコメントを表示しません。 画面にコメントを表示するには、 ファイルに echo on コマンドを含める必要があります。

  • バッチ ファイル コメントでは、リダイレクト文字 (< または >) またはパイプ (|) を使用できません。

  • コメントなしで rem を使用してバッチファイルに垂直方向の間隔を追加することもできますが、空白行を使用することもできます。 バッチ・プログラムが処理される場合、ブランク行は無視されます。

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:

config.sys ファイルの プロンプト コマンドの前に説明コメントを含めるには、次のように入力します。

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. ^)
  )