Page 1 of 1

Check file size in batch file

Posted: 24 Nov 2009 10:00
by klkemp100
Trying to write a batch file that will check the size of a file, and based on it's size do something.

Here is the scenario:

1. errorfile.txt is created by a computer application and placed in the c:\errors directory. sometimes this file has a size of 0 <zero> and sometimes it can be rather large in size

2. i would like to have a batch file check the size of this file and do the following:

if filesize of c:\errors\errorfile.txt = 0
run batchfile filesize0.bat
else
run batchfile filesizenot0.bat

thanks in advance for your help on this.

Posted: 24 Nov 2009 23:19
by ghostmachine4
read for /? and you can find the answer