首页 > 其他 > 详细

[BAT] 通过批处理删除7天前的报告,并删除当前目录下的空文件夹

时间:2015-07-15 19:00:26      阅读:267      评论:0      收藏:0      [点我收藏+]
set reportPath=D:\AutomationReport

cd /d %reportPath%

for /f "tokens=*" %%a in (‘dir /b /ad /s^|sort /r‘) do rd "%%a" 2>nul

forfiles /p %reportPath% /s /m *.xml /d -7 /c "cmd /c del /f @path">nul 2>nul

forfiles /p %reportPath% /s /m *.html /d -7 /c "cmd /c del /f @path">nul 2>nul

forfiles /p %reportPath% /s /m *.pdf /d -7 /c "cmd /c del /f @path">nul 2>nul

forfiles /p %reportPath% /s /m *.png /d -7 /c "cmd /c del /f @path">nul 2>nul

for /f "tokens=*" %%a in (‘dir /b /ad /s^|sort /r‘) do rd "%%a" 2>nul

  

[BAT] 通过批处理删除7天前的报告,并删除当前目录下的空文件夹

原文:http://www.cnblogs.com/MasterMonkInTemple/p/4649009.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!