@Echo Off For /f "tokens=*" %%i in ('dir /a-d /b /s "*.*"') do ( If "%%~zi"=="0" (Del /q /f "%%i")) Pause