11

I have two batch files which I would like to run at once. So I wrote this:

@echo off
java -jar happyjar.jar
java -jar sadjar.jar
pause

When I run the script, it first runs happyjar, then runs sadjar. Is it possible to run both jars at once without running multiple batch files?

user1797443
  • 236
  • 1
  • 5
  • 15

1 Answers1

17
@echo off
start "Title1" java -jar happyjar.jar
start "Title2" java -jar sadjar.jar
pause

The start command runs your command in a new window, so all 3 commands would run asynchronously.

Don't add /wait option, otherwise it will wait for this new window to complete before going to the next command.

StarPinkER
  • 14,081
  • 7
  • 55
  • 81