If you are like me, you at some point got use to some basic Unix utilities like good old ‘du’ (directory usage). And you may like I be wondering how to do the same sort of thing in windows?
You could also be asking yourself why you would need to do this? Well, lots of times, smaller C:\ partitions start getting full, and you want a way to easily tell which are the big space hogs. Well what seems to be a simple procedure has no real easy built in method in windows XP and earlier (I haven’t checked Vista).
What, you want to be able to call this from a script or batch file as well? Ok, well MS delivered us something called diruse. This came with the Windows 2000 Resource Kit, as something called Disk Usage (Diruse.exe).
Here is the link to download.
Though its pretty simple and ONLY a command line utility, it’s not nearly as fast as du on Unix, so be prepared to wait, especially if you have that spanking new 1TB drive that’s near full….
Here are some of the common ways I run it:
Get a listing of the subdirectories sized in MB sorted largest first:
diruse /* /M /, "C:\"|sort /R
output:
Get a listing for a remote file system:
diruse /* /M /, "\\servername/sharename/directory"|sort /R
Get just a total for the directory (useful in scripts or batch files):
diruse /M /, "C:\Program Files"
Related posts: