How can I check the size of a file in a Windows batch script?

Posted by YourComputerHelpZ on Stack Overflow See other posts from Stack Overflow or by YourComputerHelpZ
Published on 2009-07-29T11:40:44Z Indexed on 2010/03/22 22:31 UTC
Read the original article Hit count: 451

Filed under:
|
|

I want to have a batch file which checks what the filesize is of a file.

If it is bigger than %somany% kbytes, it should redirect with GOTO to somewhere else.

Example:

[check for filesize]
IF %file% [filesize thing Bigger than] GOTO No
echo Great! Your filesize is smaller than %somany% kbytes.
pause
exit
:no
echo Um... You have a big filesize.
pause
exit

© Stack Overflow or respective owner

Related posts about batch

Related posts about filesize