从Windows CMD脚本执行多个命令 [英] Executing multiple commands from a Windows cmd script
问题描述
我想写一个Windows CMD脚本在一系列执行多个任务。
然而,它总是在脚本中的第一命令之后停止。
I'm trying to write a Windows cmd script to perform several tasks in series. However, it always stops after the first command in the script.
后停止的命令是一个Maven构建(不知道这是有关)。
The command it stops after is a maven build (not sure if that's relevant).
我如何让它继续并依次运行每个任务吗?
How do I make it carry on and run each task in turn please?
安装任何软件或配置注册表等是完全不可能的 - 它已经在一个香草Windows XP安装我害怕工作
Installing any software or configuring the registry etc is completely out of the question - it has to work on a vanilla Windows XP installation I'm afraid.
在理想情况下,我想剧本中止,如果任何命令失败,但这是一个不错的,不是必需的。
Ideally I'd like the script to abort if any of the commands failed, but that's a "nice to have", not essential.
感谢。
推荐答案
当你调用另一个.bat文件,我想你需要呼的呼叫前:
When you call another .bat file, I think you need "call" in front of the call:
call otherCommand.bat
这篇关于从Windows CMD脚本执行多个命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!