Click here to Skip to main content
Licence CPOL
First Posted 19 Nov 2003
Views 287,949
Downloads 8,331
Bookmarked 67 times

Folder Size Information in the Windows Explorer Details View

By | 18 Aug 2010 | Article
This code displays the folder size information in the Explorer's Details view.
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

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
QuestionFolder Size working but Ascending and Descending order not working! PinmemberAniljpatil21:56 2 Dec '11  
QuestionThanks! - Folder Size is what I was looking for. Pinmemberww dd6:29 19 Oct '11  
GeneralGood Job! Pinmemberomzig6:03 2 Sep '11  
Questionadd a column for file/path length in windows explorer PinmemberMember 435848911:32 25 Aug '11  
GeneralMany Thanks!!! PinmemberMember 79116032:14 10 May '11  
GeneralNew DLL uploaded PinmemberSharan Basappa17:55 18 Aug '10  
GeneralBoth downloads contain the DirSize.dll but no code PinmemberThomas Schedl22:50 16 Aug '10  
GeneralRe: Both downloads contain the DirSize.dll but no code PinmemberSharan Basappa2:01 17 Aug '10  
GeneralNew DLL to show SIZE in MBs KBs and Bytes and number of Files and folders is uploaded. PinmemberSharan Basappa20:19 15 Aug '10  
GeneralGreat code doesn't work on XP x64 Pinmemberdband19:32 12 Apr '09  
QuestionHow to get Foldersize? Pinmembertallapareddy20:42 23 Jul '08  
AnswerRe: How to get Foldersize? Pinmember9ijnbhu87ygv0:35 14 Jun '09  
Questionleft click /selection on the file / folder for the path Pinmembertechbie0:51 2 Aug '07  
GeneralUsing Scripting.FileSystemObject Pinmemberclharidon23:54 5 Jun '07  
QuestionVista support? Pinmemberjordanbowness7:34 5 Mar '07  
AnswerRe: Vista support? Pinmemberalpdoruk20:49 20 Mar '07  
with my vista not working
GeneralRe: Vista support? PinmemberVikrant for VC++23:33 1 Apr '07  
GeneralRe: Vista support? Pinmemberyarp21:03 12 Apr '07  
AnswerRe: Vista support? Pinmemberm7878786:40 16 Nov '07  
GeneralFolder size in MB PinmemberKala Kasba7:33 30 Nov '06  
GeneralFor newbies Pinmemberezekiel6548:55 4 May '05  
GeneralRe: For newbies Pinmemberpinkmoon11:21 30 Jun '05  
GeneralRe: For newbies PinsussBrio133713:25 30 Jun '05  
GeneralRe: For newbies PinmemberSharan Basappa22:22 15 Aug '10  
Generalcommas PinmemberRoman Seltenreich6:16 27 Oct '04  

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

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

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