Add a comment _dos/bat to a batch file or configuration file

Source: Internet
Author: User
Tags echo command
Rem
Allows you to include comments in a batch file or a configuration file.
Grammar
REM [Comment]
Parameters
Comment
Specifies any string to be used as a comment.
/?
Displays help at the command prompt.
Comments
? Using the echo command to display annotations
The REM command does not display annotations on the screen. You must use the Echoon command in a batch or Config.nt file to display annotations on the screen.
? Restrictions on comment on batch files
You cannot use the redirection character "(" or ")" or the Pipeline (|) In a batch file comment.
? Use REM to increase vertical spacing
You can use REM without annotations to increase the vertical spacing for batch files, or you can use blank lines to increase spacing. Blank lines are ignored when processing batch programs.
Example
The following example shows a batch file that uses annotations for both interpretation and vertical spacing:
@echo off rem This batch 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:
To add a descriptive comment before the prompt command in the Config.nt file, add the following line to the Config.nt:
REM Set prompt to indicate current directory prompt $p $g

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.