Win7 Bat file exiting before all the commands are run.

padmasambhava used Ask the Experts™
Good afternoon Experts!

I've got a batch file that creates a grails app.

cd \users\peter
rd /s c:\users\Peter\.grails\2.0.3\projects\inventory
rd /s c:\users\Peter\inventory
grails create-app inventory
grails create-domain-class Inventory

The first 4 commands execute correctly but it exits before executing the create-domain-class.  How can I fix this?
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
The "grails" executable is returning control to your BAT file before it has finished processing (it is running in the background instead of running inline with the rest of your BAT file).

Try using the START /WAIT command, which will force the command prompt to wait until the calling process has terminated before continuing further.

start /wait grails create-app inventory
start /wait grails create-domain-class Inventory
cmd /c grails create-app inventory
cmd /c grails create-domain-class Inventory



Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial