我想在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“理解组成单个命令的调用线。
发布于 2014-06-09 14:07:21
不支持"\“,您需要在反斜杠(^)前加一个"^”。
我并不是说它会起作用。
发布于 2014-06-09 14:31:34
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"
发布于 2014-06-09 19:01:54
(^)它是一个错误,你必须放入(^\)
,因为\
是用来指定磁盘中的路径的,但我不确定。
https://stackoverflow.com/questions/24119154
复制相似问题