fso = new ActiveXObject("Scripting.FileSystemObject"); //fso.DeleteFolder(tmp,true ); //开始删除(如果临时文件夹系统在用,会删除失败!) //fso.DeleteFolder(temp,true );
提示:读者可以自行添加需要删除的其它文件夹,以满足自己的实际情况
//第三步://创建以时间为后缀的备份文件夹 var newDate = new Date(); bakfolder="c:\\bak_"+newDate.getYear()+"年"+(newDate.getMonth()+1)+"月"+newDate.getDate()+"日_"+newDate.getHours()+"时"+newDate.getMinutes()+"分"+newDate.getSeconds()+"秒" ; fso.CreateFolder(bakfolder);