How do I execute Windows commands in Java?

前端 未结 5 1647
遇见更好的自我
遇见更好的自我 2020-11-29 10:09

I\'m working on a project, and it will give you a list of Windows commands. When you select one, it will perform that command. However, I don\'t know how to do that. I was g

5条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-29 10:31

    I hope this helps :)

    You could use:

    Runtime.getRuntime().exec("ENTER COMMAND HERE");
    

提交回复
热议问题