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

时间:2021-05-21 12:28:43
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