日期:2014-05-17  浏览次数:20731 次

用Windows命令删除本地文件夹
private static final String CMMD = "cmd.exe /C RD /S /Q \"%s\"";

	public static void deleteFolder(String path)
	{
		File file = new File(folderPath);
		if ( !file.exists() )
		{
		}

		if ( !file.isDirectory() )
		{
		}
		
	String command = String.format(CMMD, path)		

System.out.println( "删除文件夹: " + command );
		Process process = Runtime.getRuntime().exec(command);
		process.waitFor();
	}