import java.io.IOException;
public class Example03 {
public static void main(String[] args) throws IOException {
// TODO 自动生成的方法存根
Runtime rt = Runtime.getRuntime();
rt.exec("cmd /k start cmd.exe");// 打开cmd并且显示窗口
System.out.println("Test");
}
}
2 回答

Its_forever
TA贡献361条经验 获得超328个赞
public class Test { public static void main(String[] args) { try { Runtime.getRuntime() .exec("cmd.exe /C start"); System.out.println("finish"); } catch (IOException e) { e.printStackTrace(); } } }
添加回答
举报
0/150
提交
取消