I want to check all files size in a particular folder through batch script

The below code is not giving expected result.

@ECHO OFF

setlocal enabledelayedexpansion setlocal Set maxbytesize=1000

for %%f in (D:\DOS_Testing*.txt) do ( set /p val=<%%f REM echo "fullname: %%f" echo "name: %%~nf" REM echo "contents: !val!" FOR /F "usebackq" %%A IN ('%%~nf.txt') DO set size=%%~zA

if %size% LSS %maxbytesize% (
    echo.File is ^< %maxbytesize% bytes
) ELSE (
    echo.File is ^>= %maxbytesize% bytes
)

)



Read more here: https://stackoverflow.com/questions/67412969/i-want-to-check-all-files-size-in-a-particular-folder-through-batch-script

Content Attribution

This content was originally published by Rajiba Lochan Behera at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: