Take the 2-minute tour ×

I am seeking to understand that "average" file size for a folder on my computer. I have calculated the true average of files (total size / no. of files), however I would, ultimately, love to group together files into file-size categories as follows;

Files < 1kb: 23 files.
Files < 100kb: 276 files.
Files < 1mb: 786 files.

Is this possible using a batch script?

share|improve this question
I smell XYZ problem here... –  Hello71 Jul 21 '11 at 16:36
add comment

1 Answer

Yes this is possible.

You will need to write some code that follows along an algorithm of your choice, using variables to store values.

The algorithm could look perform actions like this:

  • define File-Size-Range-Groups ( < 1kb, < 100 kb, etc )
  • Sum the number of files in each File-Size-Range-Group
  • Sum the individual file sizes for a File-Size-Range-Group total
  • Output the sum value of files in a File-Size-Range-Group
  • Output the average (total file size sum for File-Size-Range-Group / number of files in File-Size-Range-Group)
share|improve this answer
add comment

Your Answer


