Is there any syntax for multi-line code block comment in Windows batch script? I knowREM and:: for line-by-line comment, but it is not efficient to comment a code block.
I'm looking for the block comment style like something below in PHP:
/*This is multi-linesblock comment*/- 2is this what you were looking for?stackoverflow.com/questions/8526946/…Alex– Alex2014-12-11 08:46:55 +00:00CommentedDec 11, 2014 at 8:46
- Indeed... marking as duplicate..anishsane– anishsane2014-12-11 09:02:17 +00:00CommentedDec 11, 2014 at 9:02
4 Answers4
I think, this can serve the purpose
goto:skip1echo This line should not get executedformat c: & echo nor this line:skip1Comments
You may use this trick that looks better...
@echo offsetlocalset comment=goto endcommentecho This line is executed%comment%echo These linesecho are commented out...:endcommentecho The next line to execute%comment%You may place here %$#"#% anything you want.... &!>|<():endcommentecho End of exampleComments
There is no such thing in batch scripts.
(gotos excluded...)
Comments
Multiline comment without those nastygotos,rems and::
@break || ( 1 line 2 line 3 line 4 line 5 line ...)EDIT: As the previous example is not working, you can create a macro
set "[:=goto :]%%"set "[=rem/||(" & set "]=)"%[:% multiline comment%:]%(Not works in the for loop)
2 Comments
Explore related questions
See similar questions with these tags.



