First look at Windows 10's new DiskUsage analysis tool
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:
DiskUsage - Disk Usage
Description: Summarize disk usage recursively for the given directory.
Usage : diskusage [Options] [Directory]
/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):
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.
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)Advertisement