Runtime r = Runtime.getRuntime();
File file = new File(path);
String[] filelist = file.list();
File delfile = new File(path + "//" + filelist[0]);
//FileInputStream fis=new FileInputStream(path+ "//" +delfile.getName());
try
{
Runtime.getRuntime().exec(
"cmd /c start " + path + "//" + delfile.getName());
} catch (Exception e)
{
}
/**
* @param args
*/
//删除文件夹下的所有文件
public static boolean deleteAllFile(String folderFullPath)
{
boolean ret = false;
File file = new File(folderFullPath);
if (file.exists())
{
if (file.isDirectory())
{
File[] fileList = file.listFiles();
for (int i = 0; i < fileList.length; i++)
{
String filePath = fileList[i].getPath();
deleteAllFile(filePath);
}
}
if (file.isFile())
{
file.delete();
}
}
return ret;
}