如何在cmd中评论?
#
或 //
不起作用。
我的所有尝试都是通过命令提示符字面意思进行的,导致错误(找不到命令)
对于
#
:
'#' is not recognized as an internal or external command, operable program or batch file
对于
//
:
'//' is not recognized as an internal or external command, operable program or batch file
如果我没记错的话,
REM
语句就是在Windows/MS-DOS批处理文件中进行注释的方式:
> copy con hello.bat
ECHO OFF
REM this is a comment
ECHO "hello world!"
按 control-Z,然后按 [enter] 保存上述文件。
> hello
hello world!
REM
来自旧的 Microsoft BASIC 语言,其中 REM
是“备注”的缩写。