Click here to Skip to main content
12,892,729 members (47,225 online)
Click here to Skip to main content
Add your own
alternative version


78 bookmarked
Posted 19 Nov 2003

Folder Size Information in the Windows Explorer Details View

, 18 Aug 2010 CPOL
Rate this:
Please Sign up or sign in to vote.
This code displays the folder size information in the Explorer's Details view.
Sample Image - DirSize.jpg


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.


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
He is a graduate, currently working as a Software Engineer in Bangalore, India. You can reach him at

You may also be interested in...


Comments and Discussions

GeneralBoth downloads contain the DirSize.dll but no code Pin
Thomas Schedl16-Aug-10 22:50
memberThomas Schedl16-Aug-10 22:50 
GeneralRe: Both downloads contain the DirSize.dll but no code Pin
Sharan Basappa17-Aug-10 2:01
memberSharan Basappa17-Aug-10 2:01 
GeneralNew DLL to show SIZE in MBs KBs and Bytes and number of Files and folders is uploaded. Pin
Sharan Basappa15-Aug-10 20:19
memberSharan Basappa15-Aug-10 20:19 
GeneralGreat code doesn't work on XP x64 Pin
dband12-Apr-09 19:32
memberdband12-Apr-09 19:32 
QuestionHow to get Foldersize? Pin
tallapareddy23-Jul-08 20:42
membertallapareddy23-Jul-08 20:42 
AnswerRe: How to get Foldersize? Pin
9ijnbhu87ygv14-Jun-09 0:35
member9ijnbhu87ygv14-Jun-09 0:35 
Questionleft click /selection on the file / folder for the path Pin
techbie2-Aug-07 0:51
membertechbie2-Aug-07 0:51 
GeneralUsing Scripting.FileSystemObject Pin
clharidon5-Jun-07 23:54
memberclharidon5-Jun-07 23:54 
QuestionVista support? Pin
jordanbowness5-Mar-07 7:34
memberjordanbowness5-Mar-07 7:34 
AnswerRe: Vista support? Pin
alpdoruk20-Mar-07 20:49
memberalpdoruk20-Mar-07 20:49 
GeneralRe: Vista support? Pin
Vikrant for VC++1-Apr-07 23:33
memberVikrant for VC++1-Apr-07 23:33 
GeneralRe: Vista support? Pin
yarp12-Apr-07 21:03
memberyarp12-Apr-07 21:03 
AnswerRe: Vista support? Pin
m78787816-Nov-07 6:40
memberm78787816-Nov-07 6:40 
GeneralFolder size in MB Pin
Kala Kasba30-Nov-06 7:33
memberKala Kasba30-Nov-06 7:33 
GeneralFor newbies Pin
ezekiel6544-May-05 8:55
memberezekiel6544-May-05 8:55 
GeneralRe: For newbies Pin
pinkmoon30-Jun-05 11:21
memberpinkmoon30-Jun-05 11:21 
GeneralRe: For newbies Pin
Brio133730-Jun-05 13:25
sussBrio133730-Jun-05 13:25 
GeneralRe: For newbies Pin
Sharan Basappa15-Aug-10 22:22
memberSharan Basappa15-Aug-10 22:22 
Generalcommas Pin
Roman Seltenreich27-Oct-04 6:16
memberRoman Seltenreich27-Oct-04 6:16 
GeneralRe: commas Pin
Xun Ding4-May-05 9:33
memberXun Ding4-May-05 9:33 
GeneralRe: commas Pin
Xun ding4-May-05 9:35
sussXun ding4-May-05 9:35 
GeneralThanks! Pin
fuckmeplease22-Oct-04 18:09
memberfuckmeplease22-Oct-04 18:09 
Generalit would be more perfect if you correct just one line~ :) Pin
cutepsy28-Jul-04 22:02
susscutepsy28-Jul-04 22:02 
GeneralShow size in MB Pin
wilkinsonrayo26-May-04 9:29
memberwilkinsonrayo26-May-04 9:29 
GeneralRe: Show size in MB Pin
Z372131-May-04 2:53
memberZ372131-May-04 2:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    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 | Terms of Use | Mobile
Web01 | 2.8.170424.1 | Last Updated 18 Aug 2010
Article Copyright 2003 by Sharan Basappa
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid