Get the App
SLTechnology News&Howtos  ›  Development  › 

How to add comments to a batch file or configuration file

Shulou Source: shulou.com Published: 2022-06-03 07:18:38 11月15日 Update

This article mainly explains "how to add comments to a batch file or configuration file". The explanation in the article is simple and clear and easy to learn and understand. let's study and learn how to add comments to a batch file or configuration file.

Rem

Enables you to add comments to a batch file or configuration file.

Grammar

Rem [Comment]

Parameters.

Comment

Specifies any string to use as a comment.

/?

Displays help at the command prompt.

Annotation

? Use the echo command to display comments

The rem command does not display comments on the screen. You must use the echoon command in a batch or Config.nt file to display comments on the screen.

? Restrictions on comments for batch files

The redirect character "(" or ")" or pipeline (|) cannot be used in batch file comments.

? Use rem to increase vertical spacing

You can use rem without comments to increase 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 comments for interpretation 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:

To add a descriptive comment before the prompt command in the Config.nt file, add the following line to Config.nt:

Rem Set prompt to indicate current directory prompt $palleg

Thank you for your reading, the above is the content of "how to add comments in a batch file or configuration file". After the study of this article, I believe you have a deeper understanding of how to add comments in the batch file or configuration file, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Tags: Files comments plus configuration commands spacing learning content characters screens examples blank lines parameters strings that is ideas situations prompts articles more Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Shulou Technology Docker MariaDB vpn