【发布时间】:2015-02-09 15:48:32
【问题描述】:
Windows 批处理脚本中的多行代码块注释有语法吗?我知道REM 和:: 用于逐行注释,但注释代码块效率不高。
我正在寻找类似 PHP 中的块注释样式:
/*
This is multi-lines
block comment
*/
【问题讨论】:
-
确实...标记为重复..
标签: windows batch-file syntax comments
Windows 批处理脚本中的多行代码块注释有语法吗?我知道REM 和:: 用于逐行注释,但注释代码块效率不高。
我正在寻找类似 PHP 中的块注释样式:
/*
This is multi-lines
block comment
*/
【问题讨论】:
标签: windows batch-file syntax comments
我认为,这可以达到目的
goto:skip1
echo This line should not get executed
format c: & echo nor this line
:skip1
【讨论】:
批处理脚本中没有这样的东西。
(排除 goto...)
【讨论】:
你可以使用这个看起来更好的技巧......
@echo off
setlocal
set comment=goto endcomment
echo This line is executed
%comment%
echo These lines
echo are commented out...
:endcomment
echo The next line to execute
%comment%
You may place here
%$#"#% anything you want.... &!>|<()
:endcomment
echo End of example
【讨论】:
没有gotos、rems 和::的多行注释
@break || (
1 line
2 line
3 line
4 line
5 line
...
)
【讨论】: