I want to check if a file size is greater than a certain size (and perform some commands if yes).
So I need a code similar to
if filesize("myfile.txt") > 300 (
....)
How can I do this in a DOS batch script?
Thank you
Peter
How to check file size?
Moderator: DosItHelp
Re: How to check file size?
This is untested - works up to filesizes of 2 GB
Code: Select all
for %%a in ("file.txt") do if %%~za GTR 3000 echo larger than 3000 bytes