If the file name is not a parameter, you can do something like:
@echo off setlocal set file="test.cmd" set maxbytesize=1000 FOR /F "usebackq" %%A IN ('%file%') DO set size=%%~zA if %size% LSS %maxbytesize% ( echo.File is ^< %maxbytesize% bytes ) ELSE ( echo.File is ^>= %maxbytesize% bytes )
Read full article from filesize - How can I check the size of a file in a Windows batch script? - Stack Overflow
No comments:
Post a Comment