Click here to Skip to main content
6,293,171 members and growing! (11,809 online)
Email Password   helpLost your password?
Desktop Development » Shell and IE programming » General     Intermediate

Folder Size Information in the Windows Explorer Details view

By Sharan Basappa

This code displays the folder size information in the Explorer's Details view.
VC6, VC7, VC7.1Win2K, WinXP, Win2003, ATL, Dev
Posted:19 Nov 2003
Updated:20 May 2004
Views:195,944
Bookmarked:35 times
Announcements
Loading...
 
Search    
Advanced Search
printPrint   Broken Article?Report       add Share
  Discuss Discuss   Recommend Article Email
58 votes for this article.
Popularity: 6.16 Rating: 3.49 out of 5
9 votes, 15.5%
1
2 votes, 3.4%
2
5 votes, 8.6%
3
13 votes, 22.4%
4
29 votes, 50.0%
5

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 may be 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 in traversing through other files.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Sharan Basappa


Member
He is a graduate currently working as a Software Engineer in Bangalore, India. You can reach him at sharan34@yahoo.com or call at 91-9886019179
Occupation: Web Developer
Location: India India

Other popular Shell and IE programming articles:

Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 25 of 76 (Total in Forum: 76) (Refresh)FirstPrevNext
GeneralGreat code doesn't work on XP x64 Pinmemberdband20:32 12 Apr '09  
GeneralHow to get Foldersize? Pinmembertallapareddy21:42 23 Jul '08  
GeneralRe: How to get Foldersize? Pinmember9ijnbhu87ygv1:35 14 Jun '09  
Questionleft click /selection on the file / folder for the path Pinmembertechbie1:51 2 Aug '07  
GeneralUsing Scripting.FileSystemObject Pinmemberclharidon0:54 6 Jun '07  
GeneralVista support? Pinmemberjordanbowness8:34 5 Mar '07  
GeneralRe: Vista support? Pinmemberalpdoruk21:49 20 Mar '07  
GeneralRe: Vista support? PinmemberVikrant for VC++0:33 2 Apr '07  
GeneralRe: Vista support? Pinsupporteryarp22:03 12 Apr '07  
GeneralRe: Vista support? Pinmemberm7878787:40 16 Nov '07  
GeneralFolder size in MB PinmemberKala Kasba8:33 30 Nov '06  
GeneralFor newbies Pinmemberezekiel6549:55 4 May '05  
GeneralRe: For newbies Pinmemberpinkmoon12:21 30 Jun '05  
GeneralRe: For newbies PinsussBrio133714:25 30 Jun '05  
Generalcommas PinmemberRoman Seltenreich7:16 27 Oct '04  
GeneralRe: commas PinmemberXun Ding10:33 4 May '05  
GeneralRe: commas PinsussXun ding10:35 4 May '05  
GeneralThanks! Pinmemberfuckmeplease19:09 22 Oct '04  
Generalit would be more perfect if you correct just one line~ :) Pinsusscutepsy23:02 28 Jul '04  
GeneralShow size in MB Pinmemberwilkinsonrayo10:29 26 May '04  
GeneralRe: Show size in MB PinmemberZ37213:53 31 May '04  
GeneralRe: Show size in MB PinmemberSpoony11:44 21 Aug '04  
GeneralRe: Show size in MB PinmemberJac7514:00 13 Oct '04  
GeneralRe: Show size in MB Pinmemberurd_sheir1:29 3 Oct '06  
GeneralRe: Show size in MB Pinmemberaxelriet7:17 16 May '07  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 20 May 2004
Editor: Nishant Sivakumar
Copyright 2003 by Sharan Basappa
Everything else Copyright © CodeProject, 1999-2009
Web20 | Advertise on the Code Project