如何在cmd中进行评论?

问题描述 投票:0回答:1

如何在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
batch-file cmd comments
1个回答
0
投票

如果我没记错的话,

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
是“备注”的缩写。

© www.soinside.com 2019 - 2024. All rights reserved.