rem

스크립트, 일괄 처리 또는 config.sys 파일에 주석을 기록합니다. 에 주석이 없음이 지정 된 경우 rem 세로 간격을 추가 합니다.

참고 항목

이 명령은 명령줄 인터프리터 cmd.exe 내부입니다.

구문

rem [<comment>]

매개 변수

매개 변수 설명
<comment> 문자열을 주석으로 포함 하도록 지정 합니다.
/? 명령 프롬프트에 도움말을 표시합니다.

설명

  • rem 명령은 화면에 메모를 표시하지 않습니다. 화면에 메모를 표시하려면 파일에 echo on 명령을 포함해야 합니다.

  • 일괄 처리 파일 주석에는 리디렉션 문자(< 또는 >) 또는 파이프(|)를 사용할 수 없습니다.

  • 사용할 수 있지만 rem 배치 파일에 세로 간격을 추가 하려면 설명 없이 사용할 수 있습니다 빈 줄. 일괄 처리 프로그램을 처리할 때 빈 줄은 무시 됩니다.

예제

일괄 처리 파일 주석을 통해 세로 간격을 추가하려면 다음을 입력합니다.

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