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
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