First look at Windows 10's new DiskUsage analysis tool

Martin Brinkmann
Dec 16, 2020
Windows, Windows 10
|
6

DiskUsage is a new command line tool that Microsoft added to Insider Builds of the company's Windows 10 operating system without much fanfare. The tool, located in System32, provides users with information on files when run, e.g. to analyze hard drive or partition space.

The program is still in development and some of its parameters and features don't work correctly at the time of writing.

The tool's full path is C:\Windows\System32\diskusage.exe, and you can simply run it using a command prompt or a PowerShell terminal. Note that you need to run an elevated prompt for the tool to work correctly.

Use the /? parameter to display all available options, e.g. diskuage /?. Since it is located in system32, it is picked up automatically even without providing the tool's full path.

Here is the full output as it stands:

C:\WINDOWS\system32>diskusage /?
DiskUsage - Disk Usage

Description: Summarize disk usage recursively for the given directory.
Usage : diskusage [Options] [Directory]
Options :
/a, /systemAndReserve displays size for system files and reserved space
/c, /csv displays in csv format
/d, /maxDepth=N displays directory information only if it is N or
fewer levels below command line argument
/e, /minFileSize=SIZE displays directory information only if its FileSize
is greater or equal than SIZE
/f, /minSizeOnDisk=SIZE displays directory information only if its SizeOnDisk
is greater or equal than SIZE
/g, /displayFlag=FLAG specifies the flags value to determin which column(s) to display
column value description
SizeOnDisk 0x001 the on disk size
FileSize 0x002 the end of file size
SizePerDir 0x004 sum of SizeOnDisk for top level child
Files 0x008 number of child files
ChildDirs 0x010 number of child directories
FilesPerDir 0x020 number of top level child files
DirsPerDir 0x040 number of top level child directories
CreationTime 0x080 file creation timestamp
LastAccessTime 0x100 file last access timestamp
LastWriteTime 0x200 file last write timestamp
Attributes 0x400 file attributes
/h, /humanReadable displays size in human readable format
/i, /iniFile=FILE takes all the parameters from an INI file.
NOTE: SCENARIO name must be speificed via /j (/scenario)
/j, /secnario=SCENARIO specifies the scenario name for the INI file
/l, /allLinks count all hardlinks separately (By default, files with multiple
hardlinks are counted only once towards the first link name)
/m, /multipleName count only files with more than one link names
/n, /nameFilter=FILTER count only files whose name matches the name filter
/p, /preferredPath=PATH count files with multiple link names towards the first link that's
under PATH if it exists
NOTE: This options must not be specified togerther
with /l (/allLinks)
/q, /virtual recurse into virtual directories
/r, /skipReparse skip recursing into reparse directories
/s, /skipResurse skip recursing into child directories when calculating sizes
/t, /TopDirectory=N displays Top N directories by SizeOnDisk in descending order
/u, /TopFile=N displays Top N files by SizeOnDisk in descending order
/v, /verbose displays verbose error information
/x, /clearDefault do not display the default selected columns

The main purpose of DiskUsage is to return files or folders based on sizes. Parameters like minFileSize ir minSizeOnDisk return files that are larger than the specified size, TopFile returns the top X files of a directory using SizeOnDisk, and TopDirectory does the same for directories.

Output customization is supported, use displayFlag to specify the columns that you want the program to display, /csv to display the data in CSV format, or /h to display file sizes in human readable format.

Here are a few example commands (size needs to be entered in bytes):

diskusage

If you run diskusage without any parameters, it returns information about all files and folders of system32 including disk space information of folders.

diskusage /e=1073741824 c:\users\USERNAME\downloads

The command returns all files of the downloads folder that are larger than 1 Gigabyte.

Closing Words

DiskUsage is a specialized tool and most Windows users may prefer to use disk space analyzers such as WizTree or TreeSize Free instead. Still, administrators may find it useful to analyze disk space from terminal windows. One of the main advantages of DiskUsage is that it supports configuration files to run certain commands regularly.

Now You: do you analyze the disk usage of your devices? (via BleepingComputer)

Summary
First look at Windows 10's new DiskUsage analysis tool
Article Name
First look at Windows 10's new DiskUsage analysis tool
Description
DiskUsage is a new command line tool that Microsoft added to Insider Builds of the company's Windows 10 operating system without much fanfare.
Author
Publisher
Ghacks Technology News
Logo
Advertisement

Tutorials & Tips


Previous Post: «
Next Post: «

Comments

  1. Jeff said on December 18, 2020 at 10:00 am
    Reply

    Microsoft is really pathetic. Where is the GUI version of this? Explorer still can’t handle hardlinks correctly when reporting folder sizes. Doesn’t explicitly show space taken by System Restore.

  2. KB said on December 17, 2020 at 6:39 am
    Reply

    Yeah, some usage examples would have been nice. This article was more along the lines of what I was expecting.
    https://www.bleepingcomputer.com/news/microsoft/windows-10-to-get-a-built-in-command-line-disk-space-analyzer/amp/

  3. KERR said on December 17, 2020 at 1:44 am
    Reply

    Would’ve been nice to see screenshots of the output!

    1. Plants said on July 18, 2022 at 7:08 am
      Reply

      Why?
      It’s text.

      I hate it when people screenshot CLI output.
      Copy-and-paste it and save the readers’ bandwidth and webpage size.
      And it looks way better and can be searched through.

  4. Anonymous said on December 17, 2020 at 12:40 am
    Reply

    Cool and it works on Windows 7.

  5. x said on December 16, 2020 at 10:15 pm
    Reply

    I’m still gonna be using WizTree, but it’s definitely nice to have a commandline option similar to (nc)’du’

Leave a Reply

Check the box to consent to your data being stored in line with the guidelines set out in our privacy policy

We love comments and welcome thoughtful and civilized discussion. Rudeness and personal attacks will not be tolerated. Please stay on-topic.
Please note that your comment may not appear immediately after you post it.