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();
}
用Windows命令删除本地文件夹
最新推荐文章于 2023-12-22 08:59:46 发布