Check file size in batch file
Posted: 24 Nov 2009 10:00
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.
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.