I have a batch file that runs several python scripts that do table modifications.
I want to have users comment out the 1-2 python scripts that they don't want to run, rather than removing them from the batch file (so the next user knows these scripts exist as options!)
I also want to add comments to bring to their attention specifically the variables they need to update in the Batch file before they run it. I see that I can use REM
. But it looks like that's more for updating the user with progress after they've run it.
Is there a syntax for more appropriately adding a comment?
You can use :: or rem for comments. Only if comments are in if , use rem , as the colons could make errors, because they are a label.
Comments Using the :: Statement The other way to create comments in Batch Script is via the :: command. Any text which follows the :: statement will be treated as comments and will not be executed.
Use double percent signs ( %% ) to carry out the for command within a batch file. Variables are case sensitive, and they must be represented with an alphabetical value such as %a, %b, or %c. ( <set> ) Required. Specifies one or more files, directories, or text strings, or a range of values on which to run the command.
batch-file Echo @Echo off @echo off prevents the prompt and contents of the batch file from being displayed, so that only the output is visible. The @ makes the output of the echo off command hidden as well.
::
or REM
:: commenttttttttttt REM commenttttttttttt
::
doesn't work inline; add &
character:your commands here & :: commenttttttttttt
IF/ELSE
, FOR
loops, etc...) ::
should be followed with normal line, otherwise it gives error (use REM
there).::
may also fail within setlocal ENABLEDELAYEDEXPANSION
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With