- @echo off
- set "dst=C:\"
- for /r "%dst%" %%a in (.) do (
- set "nowPath=%%a"
- for /f "delims=" %%i in ('dir /a-d /b "%%a" 2^>nul') do if "%%~z$nowPath:i" lss "1" del /a/f "%%~$nowPath:i"
- dir /a/b "%%a" | findstr . >nul || attrib -s -h -r "%%a" && rd "%%a"
- )
- pause
复制代码
|