-1

I need to test my java application with JUnit4 but my application runs with a .bat file. I would need to run this .bat file in the @Before method but I don't know how can I do it.

Can you help me?

Thanks.

  • 1
    See this [answer](http://stackoverflow.com/questions/615948/how-do-i-run-a-batch-file-from-my-java-application) – Mifeet Jun 01 '13 at 11:51

1 Answers1

1

This:

Runtime.getRuntime().exec("cmd /c start filename.bat");

should do the magic ;)

For more Information see: Java docs: Runtime

Kuchi
  • 4,204
  • 3
  • 29
  • 37