Go Back   TechArena Community > Software > Operating Systems
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read SiteMap

Tags: , , , ,

Sponsored Links



How to Add Comments in Batch File

Operating Systems


Reply
 
Thread Tools Search this Thread
  #1  
Old 02-09-2009
Member
 
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
Reply With Quote
  #2  
Old 02-09-2009
Lillebror's Avatar
Member
 
Join Date: Apr 2008
Posts: 3,259
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
Quote:
Indicates a comment in a batch file or CONFIG.SYS.
REM [comment]
Reply With Quote
  #3  
Old 02-09-2009
MrChris-'s Avatar
Member
 
Join Date: Apr 2008
Posts: 3,237
Re: How to Add Comments in Batch File

We use the Rem command:

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

Example
Quote:
REM Comment line 1
REM Comment line 2
Code
:: Comment line 3
Reply With Quote
  #4  
Old 02-09-2009
Solomon's Avatar
Member
 
Join Date: May 2008
Posts: 4,056
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

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

  TechArena Community > Software > Operating Systems


Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How to Add Comments in Batch File"
Thread Thread Starter Forum Replies Last Post
make file name list in excel using batch file shibinpanayi Windows Software 1 04-06-2011 04:44 AM
Comments in File Properties gone after upgrade Tynan Operating Systems 4 24-01-2011 01:40 AM
Windows Batch file to output directory names and size to txt file m2thearkus Software Development 6 16-07-2010 01:04 AM
Dos batch file to sort files based on file names. Jon Osborn Windows Server Help 9 17-06-2009 12:06 PM
Batch file to copy a file from the local drive to a computer on lan? dudelearn Tips & Tweaks 3 12-03-2009 01:56 PM


All times are GMT +5.5. The time now is 12:39 AM.