How to comment in bat file

broken image

syntax with double quotes set 'varname=varvalue' or set 'varname=',.You can also use & or || to replace &.Įcho This is another test &rem This is another commentĪ curiosity: SET command allows limited inline comments without &rem: set 'varname=varvalue' limited inline comment here

broken image

To comment on the same line as the code you can use &:: or &rem. Since the parser never sees the lines between the goto :start statement and :start label it can contain arbitrary text (including control characters without the need to escape them) and the parser will not throw an error. Comments are used to show information in a batch script.