It’s a common enough scenario to open up My Computer and see that the amount of available free space has dwindled. When this happens, it’s a nightmare to try to figure out where all the space has gone and which applications or data folders are using up all the hard disk space.
Of course, you can go on a folder analysis expedition, in which you right-click on each folder, select the Properties command, and check the Size report on the General tab. However, this can quickly turn out to be an exasperating operation, as you'd have to check each folder individually and manually keep track of the size reports.
Faced with this task many times myself, I decided to find a better way. That's when I discovered DirGraph, a neat little freeware utility from David James Spillett that graphically maps out all the space used by each and every folder on the hard disk. As you can imagine, this tool makes it very easy to locate those folders that are hogging the most disk space.
Downloading and installing DirGraph
DirGraph is compatible with Windows 9x/ME/NT/2000/XP, and you can download it from the author’s Web site. However, keep in mind that you may need to download the Visual Basic run-time libraries in order to run DirGraph.
Try it first
You may already have the Visual Basic run-time libraries installed on your computer, so I recommend that you go ahead and try to run DirGraph before you download and install Visual Basic run-time libraries. However, keep in mind that if you already have Visual Basic run-time libraries installed on your computer and then install them again, you shouldn’t experience any problems.
Once you download the Zip file, installing DirGraph is as simple as copying the executable file DirGraph.exe to a folder on your hard disk—any folder will do.
To launch DirGraph, just double-click the executable file. When you do, you’ll see two windows appear—the main DirGraph window in the background, which is blank to start, and the Controls dialog box in the foreground, as shown in Figure A. The Change To text box shows the root of drive C:, but you can type any drive letter, a folder path, or even a UNC path to a network share. Then, click the Change To button.
|To get started, just type a drive letter, a folder path, or even a UNC path in the text box and click the Change To button.|
As soon as you do, DirGraph will begin scanning the drive. While this occurs, you can monitor the progress in the Controls dialog box, as well as in the title bar of the main DirGraph window. During this period, which can take a while depending on the size of the drive, you also can see the graph being constructed in the main window.
Once the scan operation is complete, you can reduce the Controls dialog box by clicking the small close button in the upper right hand corner. (If you click the Exit button, you’ll close down the entire DirGraph program. I’ll come back to the Show Options button in a moment.)
You’ll then see the reduced Controls dialog box at the top of the main DirGraph window. You can then maximize the main window by double-clicking its title bar. At this point, your screen will look like the one shown in Figure B. The DirGraph window is a bit unfamiliar at first, but once you get used to it, you’ll feel more comfortable with its display.
Investigating the graph
To help acclimate you to the display, let’s take a close look at the example and see how you go about investigating the graph. Starting on the left, the first column in the graph shows one block that represents the total amount of used space in the root directory of the hard disk. In this example, the data on the hard disk is using about 2.45 GB.
The second column shows five blocks, with the first four blocks representing the largest directories off the root of the hard disk. As you can see, the Windows and Documents And Settings blocks take up the biggest portions of the hard disk space at .94 GB and 1.01 GB, respectively. This is followed up by the Program Files and System Volume Information blocks at 242 MB and 301 MB, respectively.
As you can see, the bottom block in the second column is much smaller than the others and is untitled. This bottom block represents a conglomeration of all the directories off the root of the hard disk that are too small to be displayed in the column by themselves If you hover your mouse over the bottom block, you’ll see the pop-up box that shows you the total amount of space occupied by these small directories.
If you focus in on the Documents And Settings block and move to the third column, you can see that the largest directory contained here is Greg Shultz at .99 GB. Moving to the forth column, the two largest directories in Greg Shultz are Local Settings and My Documents at .62 GB and 375 MB, respectively. As you can see, this progression continues on for each of the eight columns shown in the initial display on the example system.
If you want to focus in on any directory, all you have to do is click its block. When you do, you’ll see a more detailed display of the directories it contains. For example, if you were to click on the My Documents block in the fourth column, you’ll see it move to and take up the first column. You then have a better view of the directories it contains, as shown in Figure C.
|By clicking on the My Documents block, you’ll have a full view of the directories it contains.|
If you want to move back up the graph, just click the My Documents block. You’ll then see the graph change as the Greg Shultz block takes over the first column. You can then move up to the graph to the Documents And Settings block by clicking the Greg Shultz block, and so on.
If you look again at Figures B and C, you’ll notice some gray blocks on the graph. These gray blocks represent the files contained in the directory, not within a subdirectory. For example, if you look in Figure C, you’ll see that to the right of My Pictures there is a gray block showing that the My Pictures directory contains 14 MB of files in addition to the New Building Pics directory, which contains 288 MB of files.
In addition to the sizes of the blocks, you’ll notice that each block is color coded and that a legend appears in the bottom-right corner. The color coding is used to indicate how long it’s been since the files in any directory were last changed. In this example, blocks that are color coded red have files that were changed within the last day, green means they were changed within the last week, light blue means they were changed within the last month, orange means they were changed within the last three months, pink means they were changed within the last year, and light purple blocks represent folders that contain files that haven’t been accessed in over a year.
This feature can come in handy when searching for wasted space on a hard disk. For example, if you’re using DirGraph to analyze a hard disk on a file server, you can use the color coding to help you locate directories and files that haven’t been accessed in a long time and that can be safely moved off the server and onto archive media.
Configuring the DirGraph display
There are several options that you can use to reconfigure the DirGraph display. To begin, click the close button in the upper-right corner of the reduced Controls dialog box. This will bring the Controls dialog box back to its original size. Then, click the Show Options button to expand the Controls dialog box, as shown in Figure D.
|The expanded Controls dialog box provides you with several controls you can use to configure the DirGraph display.|
The Level Width setting controls the width and the number of columns displayed on the graph. Each column width is set at 100 pixels by default, which means that at an 800 by 600 resolution, you’ll have eight columns on the screen with the default setting. At a 1024 by 768 resolution, you’ll have 10 columns on the screen. If you cut the Level Width setting down to 50, the lowest possible setting, you can double the number of columns shown in the graph at any one time.
The Max Display Depth setting controls how many directories off the root that you want DirGraph to display. In most cases, the default setting of 999 is sufficient.
As you can imagine, the Include Free Space In Size Of Drive Bars setting allows you to configure the graph to show you the entire contents of the drive, instead of just the used space. When you click the Include Free Space In Size Of Drive Bars drop down list, you’ll have two options: For Local Drives Only and For Local And Network Drives.
If you want to clean up the display a bit, you can remove the gray file blocks and the untitled directory conglomeration blocks by clearing the next two check boxes.
The Highlight Dirs drop down list allows you to control the color code application. As you can see, by default the DirGraph color-code setting is According To The Date Of Last File Change; however, you can instead select According To The Date Of Last File Access. If you prefer to disable the color-coding feature, you can select No.
If you disable the color-coding feature, you’ll want to clear the Show Key On Graph check box to remove the legend from the display. If you don’t want to include the files of the child directory in the total of the parent directory, you can clear that check box as well
Finally, you can totally reconfigure the color-coding feature. Not only can you change the colors used to highlight the boxes, you can also change the number of days in the first five categories.
Once you’ve made your configuration settings, click the Apply Options button. However, as the note says, some of the changes will require that you rescan the hard disk. To do so, just click the Change To button again.
Are you running Linux?
The author of DirGraph created this program after seeing a similar utility in UNIX and not being able to find something comparable for Windows-based systems. He has since discovered a version for Linux called xdiskusage.
Greg Shultz is a freelance Technical Writer. Previously, he has worked as Documentation Specialist in the software industry, a Technical Support Specialist in educational industry, and a Technical Journalist in the computer publishing industry.