Home > Commands N-Z > Batch R

REM


Description | Syntax | Parameters | Switches | Related | Notes | Examples | Errorlevels | Availability

Enables you to include comments in a batch file or in your CONFIG.SYS file. The REM command - (or double colon (::) in batch files), is also useful for disabling commands. (You can use a semicolon (;) instead of the REM command in your \CONFIG.SYS (Win9x \MSDOS.SYS & REG files), but not in batch files)


Syntax

REM /?

REM [string]


Parameters
string (v1.0 Win95 NT3.5)
Specifies any, upto 123-character, string of characters -- the command you want to disable or the comment you want to include.

Switches
/? (NTXP)
Displays help.

Related

For information about displaying messages, see the ECHO command.
Equivalent Linux BASH commands:
### - Comment / Remark.


Notes
Using the ECHO command to display comments

The REM command does not display comments on the screen. You must use the ECHO ON command in your batch or CONFIG.SYS file in order to display comments on the screen.


Restrictions on characters in batch-file comments

You cannot use a redirection character (> or <) or pipe (|) in a batch-file comment.

You can redirect to create zero-length files in DOS and WIN, but NOT in NT.


Using REM to add vertical spacing

Although you can use REM without a comment to add vertical spacing to a batch file, you can also use blank lines. The operating system ignores the blank lines when processing the batch program.


Examples

This example shows a batch file that uses remarks for both explanations and vertical spacing:

    @ECHO OFF
     REM  This batch program formats and checks new disks.
     REM  It is named CHECKNEW.BAT.
     REM
     ECHO Insert new disk in drive B.
     PAUSE
     FORMAT B: /V
     CHKDSK B:

Suppose you want to include in your CONFIG.SYS file an explanatory comment before the COUNTRY command. To do this, add the lines to CONFIG.SYS:

    REM Set country code to France
    COUNTRY=033

This example shows a DEVICE command that has been disabled by using a semicolon (;) instead of the REM command:

    ;DEVICE=C:\DOS\RAMDRIVE.SYS

Errorlevels

none.


Availability
Internal
DOS
v1.0 v1.05 v1.1 v1.11 v1.24 v1.25 v1.85 v2.0 v2.01 v2.05 v2.10 v2.11 v2.11R v2.12 v2.2 v2.25 v3.0 v3.20 v3.05 v3.1 v3.21 v3.25 v3.30 v3.3A v3.3R v3.3T v3.31 v3.40 v4.0 v4.01 v4.01A v5.0 v5.0A v5.00.02 v5.001A v5.01 v5.02 v6.0 v6.10 v6.2 v6.21 v6.22 v6.23 v7.00 v7.0R1 v7.10 v8.00
Windows
Win95 Win98 WinME
Windows NT
NT3.5 NT4 NT2000 NTXP NT2003