1 @echo off 2 set REPOSITORY_PATH=. epository 3 echo 正在搜索lastUpdated文件... 4 for /f "delims=" %%i in ('dir /b /s "%REPOSITORY_PATH%*lastUpdated*"') do ( 5 del /s /q %%i 6 ) 7 echo 清理完毕 8 echo 正在搜索空文件夹... 9 for /f "delims=" %%a in ('dir /ad /b /s "%REPOSITORY_PATH%"^|sort /r') do ( 10 rd "%%a">nul 2>nul &&echo 空目录"%%a"成功删除! 11 ) 12 echo 清理完毕 13 pause