John Roberts
John Roberts

Reputation: 5966

Batch File Ending Prematurely

I have a batch file with the following commands (to set up a compiler):

del Yylex.java

jflex scanner.flex

del parser.java

java -jar java-cup-11a.jar parser.cup

However, for some reason, after the conclusion of jflex scanner.flex, the batch script ends and command prompt closes. If I just run that command separately, this does not happen. Does anyone know what's wrong?

Upvotes: 1

Views: 683

Answers (1)

Magoo
Magoo

Reputation: 79982

Is jflex a batch file?

If so, try

CALL jflex ...

or

start /wait "" jflex ...

(well, actually - give it a whirl anyway, can't hurt...)

When bat is asked to run another batch, it merely transfers control to that other batch and has no idea of where to return. CALL or START gives it a ticket home...

Upvotes: 1

Related Questions