At the end of every dir listing, there will be a line like the following:
9 Dir(s) 1,617,453,056 bytes free
You just need to figure out a way to scrape that info from within your program. Of course if you used a language like Perl, Python, or Ruby, there would likely be a built-in function for doing this... Or at the very least, it would be considerably easier to use regular expressions to extract just the bit of data you want.
Does anyone know of a quick and simple way to get the amount of free disk space left on the HDD in WinXP Home? I need to use a batch file to monitor and record the remaining disk space at regular intervals.