How do I run a batch file from my Java Application?

后端 未结 11 1697
情书的邮戳
情书的邮戳 2020-11-22 00:42

In my Java application, I want to run a batch file that calls \"scons -Q implicit-deps-changed build\\file_load_type export\\file_load_type\"

It seems t

11条回答
  •  长发绾君心
    2020-11-22 01:14

    To run batch files using java if that's you're talking about...

    String path="cmd /c start d:\\sample\\sample.bat";
    Runtime rn=Runtime.getRuntime();
    Process pr=rn.exec(path);`
    

    This should do it.

提交回复
热议问题