Executing multiple commands from a Windows cmd script

Darren Greaves picture Darren Greaves · Oct 13, 2008 · Viewed 274.5k times · Source

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.

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?

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.

Thanks.

Answer

Lou Franco picture Lou Franco · Oct 13, 2008

When you call another .bat file, I think you need "call" in front of the call:

call otherCommand.bat