Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Total size of files under folder in command line?

Status
Not open for further replies.

kasparov

Programmer
Feb 13, 2002
203
GB
Hello - If I right click on a folder in Windows Explorer & select Properties it shows me Size & Size on Disk - not sure of the difference but either are good enough as an estimate of the amount of space used by files under my chosen folder.

How can I report this figure at the command prompt? I want to write a batch file which will report this figure.

I had assumed that there would be a switch to the dir command but there isn't.

Thanks in advance - Chris
 
It's OK - ignore me! The Total files listed result from dir /s is close enough (but doesn't give exactly the same figures - anyone know why?)

Chris
 
The difference between size and size of disks is because data is stored into data cubes of some amount called whatever, I can't remember the name right now (clusters?). Last time I looked at it that size was 512kb.

So, a file of 513kb would need two of that cubes, and the acutal disk size occupied would be 1024kb. This is the worst case.

About the difference with MSDOS, could have to do with hidden files. Try dir /s /a

Cheers,
Dian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top