java运行调用命令或运行其他程序

public void runCommond(String cmd, String dir)
			throws InterruptedException, IOException {
		Runtime run = Runtime.getRuntime();
		Process process = run.exec("cmd /c " + cmd, null, new File(dir));
		process.waitFor();
		process.destroy();
	}
//删除SVNTemp目录下history和recent文件夹及子项
runCommond("del /q history,recent", "D:\\SVNTemp\\");

你可能感兴趣的:(java)