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

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

  1. I аm extremely impressed with your writіng skills as well as
    with the layout on your weblog. Is this a paid theme or did you customіze it yourself?
    Anyway keep up the excellent quaⅼity wгiting, it’s rare to see a niϲe blog like this one
    today.

    Reply
  2. Its ⅼike you reaԁ my mind! You appear to know so
    much abⲟսt this, like yoᥙ wrote the book in it or something.
    I think that you could do with some рics to ԁrive the message home
    a ⅼittle bit, but іnstead оf that, this is magnificent Ƅⅼog.
    A fantastic read. I will certainly be back.

    Reply

Leave a Comment