This batch file tells you how many files and how much much disk space is used in a directory and all its subdirectories. If called with the parameter /d it lists each subdirectory otherwise it just prints the total number of files and bytes. Actual disk space consumed is somewhat higher because of cluster slack. Figure about half of the cluster size times the number of files for overhead. 100 files with a cluster size of 8k wastes about 400K. A floppy with 512 byte clusters uses only 25K extra for the same 100 files.
@echo off if not '%1=='/d goto justhowmuch dir /a-d /s|find "i"|find /v "Volume"|more goto done :justhowmuch dir /a-d /s|find "file(s)"|sort /r|find /n "f"|find "[1]" echo [1ATotal: :done