How to use ‘DiskUsage’ command to check drive space on Windows 11

The DiskUsage command lets to see what files are taking up space on the hard drive, and here's how on Windows 11.

Windows 11 DiskUsage command
Windows 11 DiskUsage command

“DiskUsage” is a command-line tool for Windows 11 to quickly analyze the contents of a given folder (or the entire drive) to understand how space is being used and determine the files taking the most space, which can come in handy to free up space

The command-line tool also includes a bunch of options to customize the report details. For example, you can use the /minFileSize option to find files equal to or larger than the size you specified. The /u and /t let you see the top files for a specific location and many other options.

This guide will teach you the steps to get started using the DiskUsage command-line tool on Windows 11.

Check drive space usage with DiskUsage on Windows 11

To use the DiskUsage command to view the folder or drive usage on Windows 11, use these steps:

  1. Open Start on Windows 11.

  2. Search for Command Prompt, right-click the top result, and select the Run as administrator option.

  3. Type the following command to analyze the storage usage of a folder and press Enter:

    DiskUsage PATH/TO/LOCATION /h

    In the command, replace the PATH/TO/LOCATION for the location you want to analyze. For example, this command analyzes the contents of the Downloads folder:

    DiskUsage C:\Users\user\Downloads /h

    DiskUsage path

    In this example, the command generates a report of the disk space usage for the current location:

    DiskUsage /h
    Quick tip: The option /h is not a requirement, but it will display the size in a more readable format, such as in KB, MB, or GB.
  4. Type the following command to find files larger than 4GB and press Enter:

    DiskUsage /minFileSize=FILE-SIZE-KB PATH/TO/LOCATION /h

    For example, this command will look and list files larger than 15MB in the Downloads folder:

    DiskUsage /minFileSize=1966080 C:\Users\user\Downloads /h

    DiskUsage file size

  5. Type the following command to list the top files by size on disk in descending order for a given location and press Enter:

    DiskUsage PATH/TO/LOCATION /h /u=NUMBER

    In the command, replace the PATH/TO/LOCATION for the location you want to analyze and NUMBER with the number of files you want to see.

    For example, this command lists the top ten files from the system32 folder:

    DiskUsage C:\windows\system32 /h /u=10

    DiskUsage top files

  6. Type the following command to list the top folders by size on disk in descending order for a given location and press Enter:

    DiskUsage PATH/TO/LOCATION /h /t=NUMBER

    In the command, replace the PATH/TO/LOCATION for the location you want to analyze and NUMBER with the number of folders you want to see. For example, this command lists the top ten folders from the system32 folder:

    DiskUsage C:\windows\system32 /h /t=10

    DiskUsage top folders

Once you complete the steps, you will understand how space is used by files in a specific location or the entire drive.

The DiskUsage tool offers many other options that you can use in many scenarios. You can use the DiskUsage /? command to list all the options available and their descriptions.

If commands are not your thing, Windows 11 also include Storage Sense to view the drive space usage, or you can also use third-party tools, such as WinDirStat, to see what files are taking up the hard drive to take action accordingly.

About the author

Mauro Huculak is a Windows expert and the Editor-in-Chief who started Pureinfotech in 2010 as an independent online publication. He is also been a Windows Central contributor for nearly a decade. Mauro has over 12 years of experience writing comprehensive guides and creating professional videos about Windows, software, and related technologies, including Android and Linux. Before becoming a technology writer, he was an IT administrator for seven years. In total, Mauro has over 20 years of combined experience in technology. Throughout his career, he achieved different professional certifications from Microsoft (MSCA), Cisco (CCNP), VMware (VCP), and CompTIA (A+ and Network+), and he has been recognized as a Microsoft MVP for many years. You can follow him on X (Twitter), YouTube, LinkedIn and About.me.