Click here to Skip to main content
Click here to Skip to main content

Folder Size Information in the Windows Explorer Details View

By , 18 Aug 2010
 
Sample Image - DirSize.jpg

Introduction

In day to day life, when one wants to know the size of a folder, (s)he has to right click on the folder name and has to choose the Properties. Using this DLL, one can view the folder size as one of the columns of the Explorer as shown in the image. We also have the facility to sort according to the folder size. (I did not do anything to sort, it is done by Explorer. :))

This class implements the Shell interface called IColumnProvider. Using this interface, one can customize the Explorer's Details view. This class adds one more column to the Details view, which displays the consolidated folder size.

To build this project, you must install Microsoft Platform SDK, or click here [53.5 KB] to download SHLOBJ.h.

How to Use the DLL

Well, if you build the project, you need not do anything, since the IDE automatically registers the DLL. If demo project is downloaded, then unzip the DLL and register it using the command "regsvr32 <Path of the unzipped DLL>". E.g., Regsvr32 c:\DirSize.DLL, if the DLL is present in C:.

Scope for Further Improvements

This code can be modified to display the number of files/folders in the folder. Or maybe, you can pack two more classes to display columns for number of files and number of folders into the same DLL to do so.

Performance Issues

When the user selects the "Folder Size" item from the Explorer context menu, the Explorer starts calculating the folder size by traversing all the files and nested folders. First time, it might take some minutes depending upon the contents of the folder. But all the operations are done in the background (Explorer is smart enough!.. Ehh). So this won't stop you from traversing through other files.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Sharan Basappa
Team Leader
India India
Member
He is a graduate, currently working as a Software Engineer in Bangalore, India. You can reach him at sharan34@yahoo.com

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
Hint: For improved responsiveness ensure Javascript is enabled and choose 'Normal' from the Layout dropdown and hit 'Update'.
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
GeneralMy vote of 5mvpMichael Haephrati מיכאל האפרתי20 Feb '13 - 5:07 
QuestionFolder Size working but Ascending and Descending order not working!memberAniljpatil2 Dec '11 - 21:56 
QuestionThanks! - Folder Size is what I was looking for.memberww dd19 Oct '11 - 6:29 
GeneralGood Job!memberomzig2 Sep '11 - 6:03 
Questionadd a column for file/path length in windows explorermemberMember 435848925 Aug '11 - 11:32 
GeneralMany Thanks!!!memberMember 791160310 May '11 - 2:14 
GeneralNew DLL uploadedmemberSharan Basappa18 Aug '10 - 17:55 
GeneralBoth downloads contain the DirSize.dll but no codememberThomas Schedl16 Aug '10 - 22:50 
GeneralRe: Both downloads contain the DirSize.dll but no codememberSharan Basappa17 Aug '10 - 2:01 
GeneralNew DLL to show SIZE in MBs KBs and Bytes and number of Files and folders is uploaded.memberSharan Basappa15 Aug '10 - 20:19 
GeneralGreat code doesn't work on XP x64memberdband12 Apr '09 - 19:32 
QuestionHow to get Foldersize?membertallapareddy23 Jul '08 - 20:42 
AnswerRe: How to get Foldersize?member9ijnbhu87ygv14 Jun '09 - 0:35 
Questionleft click /selection on the file / folder for the pathmembertechbie2 Aug '07 - 0:51 
GeneralUsing Scripting.FileSystemObjectmemberclharidon5 Jun '07 - 23:54 
QuestionVista support?memberjordanbowness5 Mar '07 - 7:34 
AnswerRe: Vista support?memberalpdoruk20 Mar '07 - 20:49 
GeneralRe: Vista support?memberVikrant for VC++1 Apr '07 - 23:33 
GeneralRe: Vista support?memberyarp12 Apr '07 - 21:03 
AnswerRe: Vista support?memberm78787816 Nov '07 - 6:40 
GeneralFolder size in MBmemberKala Kasba30 Nov '06 - 7:33 
GeneralFor newbiesmemberezekiel6544 May '05 - 8:55 
GeneralRe: For newbiesmemberpinkmoon30 Jun '05 - 11:21 
GeneralRe: For newbiessussBrio133730 Jun '05 - 13:25 
GeneralRe: For newbiesmemberSharan Basappa15 Aug '10 - 22:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web01 | 2.6.130523.1 | Last Updated 18 Aug 2010
Article Copyright 2003 by Sharan Basappa
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid