windows - 使用多行发出单个命令

标签 windows batch-file

我想在 Windows 批处理文件中执行以下行:

CALL createdoc.bat --create=yes --summary="my summary goes here" --publisher="my publisher name goes here" --website="my website address" --details="details.doc" --license="license.doc" --tocfile="../../../toc.doc"

当参数个数超过3个时,这一行就很长了。我尝试了以下方法使批处理文件看起来干净且易于阅读。

CALL createdoc.bat --create=yes \
                   --summary="my summary goes here" \
                   --publisher="my publisher name goes here" \
                   --website="my website address" \
                   --details="details.doc" --license="license.doc" \
                   --tocfile="../../../toc.doc"

但是它不起作用。 cmd 不理解它们是单独的命令。我的问题是:如何让我的批处理文件看起来干净,但仍然让“cmd”理解构成单个命令的 CALL 行。

最佳答案

不支持“\”,需要在反斜杠前加一个“^”,(^)。

我并不是说它会起作用。

关于windows - 使用多行发出单个命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24119154/

相关文章:

windows - CakePHP:警告 (512):模型 "User"与模型 "User"无关 Windows 到 Ubuntu 部署

windows - 批处理以列出不包含特定文件的文件夹

batch-file - 通过命令行使用苏门答腊pdf批量打印pdf

java - 在java中运行关闭 Hook 的问题

python - 如何对文件夹中的所有文件运行批处理文件?

c# - 从 C# 强制运行批处理文件从文件目录运行?

windows - 初始化 guard-livereload 时出错

windows - 如何压缩文件名中包含今天日期的文件夹?

c++ - 如何检查dll的引用计数?如何知道 dll 的加载位置?

batch-file - 批处理文件查找 USB 驱动器并更改驱动器号