Runtime类调用Windows系统cmd命令?
例如:
public class ShowDate {
? ?
public static void main(String[] args) {
Runtime run=Runtime.getRuntime();
try {
run.exec("cmd /k start d:\\date.bat");
} catch (Exception e) {
e.printStackTrace();
}
}
}
date.bat文件内容:date
?
?