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

set reportPath=D:\AutomationReport

cd /d %reportPath%

forfiles /p %reportPath% /s /m *.xml /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

  

posted on 2015-07-15 17:32  张缤分  阅读(560)  评论(0)    收藏  举报

导航