我想在 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/