How to “comment-out” (add comment) in a batch/cmd?

The rem command is indeed for comments. It doesn’t inherently update anyone after running the script. Some script authors might use it that way instead of echo, though, because by default the batch interpreter will print out each command before it’s processed. Since rem commands don’t do anything, it’s safe to print them without side effects. To avoid printing a command, prefix it with @, or, to apply that setting throughout the program, run @echo off. (It’s echo off to avoid printing further commands; the @ is to avoid printing that command prior to the echo setting taking effect.)

So, in your batch file, you might use this:

@echo off
REM To skip the following Python commands, put "REM" before them:
python foo.py
python bar.py

4 thoughts on “How to “comment-out” (add comment) in a batch/cmd?”

  1. Hеy! Someone in my Faϲebook group shared this weЬsite with uss so I came to givce it a ⅼoⲟk.
    I’m definiteoу loving the information. I’m book-marking and will Ьe tweeting this to
    my fߋllowers! Exceptional Ьloց ɑnd superb design and style.

    Reply
  2. I am curious to find out what blog system you happen to
    be using? I’m having some minor security problems with my latest
    blog and I would like to find something more safeguarded.
    Do you have any solutions?

    Reply
  3. Hello There. I found your blog using msn. This is a very well written article. I will be sure to bookmark it and return to read more of your useful info. Thanks for the post. I will definitely comeback.

    Reply

Leave a Comment