以下JAVA代码类似执行DOS命令,打开资源管理器和计算器:
public static void main(String[] args) {
try {
Runtime.getRuntime().exec("explorer");
Runtime.getRuntime().exec("C:\\\\Windows\\\\System32\\\\calc.exe");
} catch (Exception e) {
e.printStackTrace();
}
}