public class TestCmd {
public TestCmd(){}
public static void main(String args[]){
try {
//登录网站
Process process = Runtime.getRuntime().exec("cmd.exe /c start http://www.hao123.net/");
//调用Ping命令
Process process = Runtime.getRuntime().exec("cmd.exe /c start ping 10.5.2.19");
}catch (Exception e)
{
e.printStackTrace();
}
}
}