Results 1 to 4 of 4

Thread: How to Add Comments in Batch File

  1. #1
    Join Date
    Dec 2008
    Posts
    55

    How to Add Comments in Batch File

    Hello , i wish to create a Batch File , and want to add comments to It , almost i know how to create the batch file, but i really dont know how to add comment in batch file , would you please guide by Giving simple examples or Syntax , on how to add comments in Batch file , please help me , thanks to All

  2. #2
    Join Date
    Apr 2008
    Posts
    3,295

    Re: How to Add Comments in Batch File

    A batch file (or bat) is a batch file: it is plain text file, saved with the extension *. bat file containing a set of DOS commands. When you run this bat file, the contents commands are executed in groups, sequentially, allowing automate various tasks. Any DOS command can be used in a batch file , and the Command for Adding comment is rem command

    REM
    Indicates a comment in a batch file or CONFIG.SYS.
    REM [comment]

  3. #3
    Join Date
    Apr 2008
    Posts
    3,267

    Re: How to Add Comments in Batch File

    We use the Rem command:

    Syntax
    Rem Comments
    But you can also use ::
    Syntax:
    :: Comments

    Example
    REM Comment line 1
    REM Comment line 2
    Code
    :: Comment line 3

  4. #4
    Join Date
    May 2008
    Posts
    4,085

    Re: How to Add Comments in Batch File

    The rem means that the comments is inactivated ,The rem command before the line indicates the Next Text is a comment under DOS batch

    It is possible to place comments in the batch files. For this, we must begin the line with the keyword REM. In fact, everything that follows this command is simply ignored. To display text, the Echo command should be , Breaks can also be performed in the same file with the goto command followed by the name of a label. A label is a single word placed on one line and beginning with ":", for example: test. Here is a batch showing all these controls

    @ echo off
    rem This file is totally useless
    echo Start of execution
    goto result
    echo This line is skipped
    : Following
    echo is the end

Similar Threads

  1. Learning Batch file to open a program or a file
    By Ikshana in forum Windows Software
    Replies: 3
    Last Post: 04-04-2011, 07:24 PM
  2. Comments in File Properties gone after upgrade
    By Tynan in forum Operating Systems
    Replies: 4
    Last Post: 24-01-2011, 01:40 AM
  3. Windows Batch file to output directory names and size to txt file
    By m2thearkus in forum Software Development
    Replies: 6
    Last Post: 16-07-2010, 12:04 AM
  4. Dos batch file to sort files based on file names.
    By Jon Osborn in forum Windows Server Help
    Replies: 9
    Last Post: 17-06-2009, 11:06 AM
  5. Replies: 3
    Last Post: 12-03-2009, 12:56 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,025,877.95789 seconds with 17 queries