Subscribe

Get the Network Administrators tool pack

Subscribe to our newsletter and get 11 free network administrator tools, plus a 30 page user guide so you can get the most out of them.

Click Here to get your free tools

Recent Posts

Search

Archives

Calculate folder size from the command line

Post image for Calculate folder size from the command line

by Steve Wiseman on July 23, 2010 · 8 comments

in Tips,Tools,Utility,Windows


.

Even with the huge amount of space that I have, I am always running out. When that happens I start digging.

Usually I wait through this:

Folder Properties

If you have more than just a few folders, it can be a huge waste of time.

I ran across a free tool from Microsoft called “Disk Usage”

You can download it from here

It is a command line tool. Point it at any folder, and get the same information:

Folder Properties DU

With one catch – it is much faster than using Windows Explorer 😉

For example, I went to the properties of a development folder on our server. It took 1 minute and 10 seconds to get the total size.

With Disk Usage it took 15 seconds.

The next part I am about to show you is even better. It is the real reason I love this tool. If you use the -v option, it will show you a breakdown of how much each sub folder is taking up:

Folder Disk Usage

Now with a quick glance, I can see what folders are taking up the most space. From there I can investigate and clean out anything that is not needed.

One more thing…Subscribe to my newsletter and get 11 free network administrator tools, plus a 30 page user guide so you can get the most out of them. Click Here to get your free tools

Related Articles:

{ 8 comments… read them below or add one }

1 Sam January 4, 2012 at 2:44 pm

DU is much slower then windows explorer on my network tests. ON 49 gb folder took over 5 minuets longer.

2 cheryl March 24, 2012 at 6:09 am

how do i specify level? my list is way too long with -v for me to copy it out…

3 TK November 30, 2012 at 4:11 pm

Does this work with 64bit windows? It won’t run on my windows 7 64bit machine

4 Yael May 27, 2013 at 3:24 pm

Sweet!! Thanks! Brand new!

5 jaygdee June 11, 2013 at 5:38 pm

Great find! Works great locally and on remote machines. Any way I can batch this to check the size of a list of remote users’ desktop, documents, and pictures folders?

6 Dr Paul Lam January 28, 2014 at 8:38 pm

I like DU very much.
This is a very useful DOS command that I have come across recently.
BTW, I am a DOSmania.

Many thanks to you, Mr Steve Wiseman.
.

7 eeldivad March 11, 2015 at 3:05 am

This powershell function is much faster, at least 10-100 times faster it seems for very large folders from my tests.

http://blogs.technet.com/b/heyscriptingguy/archive/2013/08/03/weekend-scripter-use-powershell-to-get-folder-sizes.aspx

8 eeldivad March 16, 2015 at 12:43 am

I’ve polished the script from previous link into my own powershell function with more features that is faster than anything else I’ve found to calculate folder size.

https://gallery.technet.microsoft.com/scriptcenter/get-foldersize-224916dd/view/Reviews

Leave a Comment

Category Links - Windows Forum - Exchange Forum