这一项工作…使用&&运算符,您可以添加一个或要在同一命令提示符下执行的命令
try { Process p = Runtime .getRuntime() .exec("cmd /c start cmd.exe /K "dir && ping localhost && echo end""); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); }考虑该解决方案在这里也
来自发问者的更新:在cygwin中执行命令的解决方案
getRuntime().exec("cmd /c start C:/cygwin64/bin/bash.exe --login -c "ls ; whoami ; exec bash"");


