@echo off setlocal EnableExtensions EnableDelayedExpansion if "%~1"=="" ( echo Usage: %~nx0 folder exit /b 2 ) set "DIR=%~1" if not exist "%DIR%\" ( echo Folder not found: %DIR% exit /b 1 ) set "TOTAL=0" for %%E in (zip 7z tar gz tgz zst rar) do ( set "COUNT=0" for %%F in ("%DIR%\*.%%E") do ( if exist "%%~fF" set /a COUNT+=1 ) if !COUNT! GTR 0 ( echo %%E - !COUNT! set /a TOTAL+=!COUNT! ) ) echo Total archives: !TOTAL! endlocal exit /b 0