How do I check my hard drive size in command prompt?

The command prompt, also known as the command line or cmd, is a text-based interface in Windows operating systems to execute commands. It provides power users more control over the system through a CLI (command line interface) rather than a graphical user interface (GUI). Using the command prompt to check your hard drive size offers some advantages over GUI methods:

  • It provides more detailed and precise information about your drives.
  • You can check the size through different commands to view the information in different ways.
  • It works even if the graphical interface is not loaded properly.
  • You can combine it with other commands or scripting to automate system administration tasks.

Overall, the command prompt offers advanced functionality for computer experts and IT professionals who are comfortable working with text-based systems. Checking hard drive sizes through the command prompt provides efficient and robust tools to deeply understand your storage capacity.

Prerequisites

Before checking your hard drive size in Command Prompt, there are a couple prerequisites that need to be met:

You need to be using a Windows operating system. Command Prompt is available on Windows 11, Windows 10, Windows 8, Windows 7, and other Windows NT-based operating systems. It does not work on macOS, Linux, Android, or other non-Windows platforms.

You also need administrative access on your computer. Running Command Prompt as an administrator gives you full permissions to run system commands and see information about your hard drive. On a personal computer you own, you likely have admin access already. But on a work computer you may need to request elevated permissions.

As long as you are on a Windows OS and have admin rights, you should be able to follow the steps below to check hard drive size in Command Prompt.

Open the Command Prompt

To open the Command Prompt in Windows 10 or 11, the easiest method is to type “command prompt” in the Windows search bar and select the “Command Prompt” app. This will launch a command prompt window.

Alternatively, you can open the Start menu and scroll down to the Windows System section. Click on “Command Prompt” to launch it.

You can also use the Windows key + R keyboard shortcut to open the Run dialog box. Type “cmd” and hit Enter to open Command Prompt. Additionally, hold the Windows key and press X to open the Power User menu, then select “Command Prompt” 1.

For quicker access, you can right-click on the Start menu and select “Command Prompt” or pin it to your taskbar or Start menu. You can also create a desktop shortcut by right-clicking on the desktop, selecting New > Shortcut, typing “cmd” as the location, and clicking Next.

diskpart Command

The diskpart command is used to view disk information and manage disks in Windows. To use it, first open the Command Prompt as an administrator. Then type “diskpart” and press enter to launch the diskpart utility.

To list available disks, type “list disk” and press enter. This will show all disks connected to the system with their disk numbers, size, and status. Disks marked with an asterisk are boot disks.

To select a disk to work with, type “select disk X” where X is the disk number. Once selected, you can run commands like “clean” and “create partition” on that disk.

For example:


diskpart
list disk

select disk 2
clean

This would select disk 2 and clean it, erasing all existing partitions (see this guide for more diskpart examples).

list volume Command

The list volume command displays all volumes on a computer’s disks in the diskpart prompt. This gives you a list of the drive letters, size, and other details for each volume.

To use list volume, first open an elevated command prompt and type “diskpart” to enter diskpart mode. Then type “list volume” and press enter.

For example, the output may look something like this:

Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
----------  ---  -----------  -----  ----------  -------  ---------  --------
Volume 0     C                NTFS   Partition    126 GB  Healthy    System  
Volume 1         OS           NTFS   Partition    350 GB  Healthy    Boot
Volume 2     D   Data        NTFS   Partition    536 GB  Healthy    
Volume 3     E   Backups     NTFS   Partition    100 GB  Healthy

This shows drive C as the system volume, drive D as the data volume, etc. The output displays the volume number, drive letter, label name, file system type, partition type, total size, status, and info for each volume.

The list volume command is useful for getting a quick overview of all the volumes on the disks before performing disk management operations like formatting, extending, deleting partitions, etc. It’s one of the most basic and frequently used diskpart commands.

For more details, see the Microsoft documentation on list volume.

fsutil volume Command

The fsutil volume command can be used to query information about volumes on your hard drive in Windows. The basic syntax is:

fsutil volume query [options]

Some examples of using fsutil volume:

To get the total size of a volume in bytes:

fsutil volume diskfree C:

To get the total free space available on a volume:

fsutil volume query free C:

To get the size of the largest contiguous free space on a volume:

fsutil volume query available C:

So fsutil volume allows you to easily get detailed information about the total, used, and free space on your hard drive volumes from the command line in Windows.

For more details, see this Microsoft documentation: fsutil volume

wmic Command

The wmic (Windows Management Instrumentation Command) command can be used to get information about logical drives in Windows. The wmic logicaldisk command will display information about all logical drives on the system.

For example, to list all logical drives on a system, you can use:

wmic logicaldisk get caption,description,providername

This will output something like:

Caption  Description                    ProviderName    
C:       Local Fixed Disk               vmicbios     
D:       CD-ROM Disc                    vmicbios

The caption shows the drive letter, description shows details about the drive, and providername shows the driver providing access to the drive.

To get the size of each drive in GB, you can use:

wmic logicaldisk get caption,size,freespace,systemname 

This gives output like:

Caption  Size     FreeSpace         SystemName
C:       99.01GB  80.21GB           MYCOMPUTER
D:       3.73GB   0.00GB            MYCOMPUTER  

So the wmic command provides an easy way to get detailed information about logical drives from the command prompt.

dir Command

The dir command can be used to display information about a hard drive volume in the command prompt. To show volume information using dir, type “dir” at the command prompt without any additional parameters. This will display a list of files and directories on the current drive, along with the drive’s volume label and serial number.

For example, typing “dir” and hitting enter may display something like:

Volume in drive C is Windows
Volume Serial Number is 1234-5678

The first line shows the volume label, which is typically the name given to the drive. The second line reveals the volume serial number. This is a unique identifier assigned to the volume when it is formatted.

The dir command alone provides a quick way to check the volume label and serial number of the current drive from command prompt. It does not show the full model, size, or brand of the drive however. For that additional information, other commands would be needed. But for a fast check of the volume details, dir command is quite useful.

Troubleshooting

Here are some common errors and solutions when checking your hard drive size in Command Prompt:

Error: The hard drive shows the wrong capacity.

Solution: This can happen if the hard drive is initialized to the wrong partition table. Drives over 2TB need to use the GPT partition table. You can convert the drive to GPT by using the ‘convert’ command in diskpart. See this guide for instructions.

Error: The chkdsk or fsutil commands show less space than expected.

Solution: These commands may not factor in space used by system files and partitions. Use the ‘wmic diskdrive get size’ command to get the full raw capacity of the drive. See this guide for details.

Error: Access denied errors when running commands.

Solution: Open Command Prompt as administrator to run the commands with elevated permissions. Right-click the Start menu and choose Command Prompt (Admin).

Summary

There are a few different commands that can be used to check hard drive size in the Windows command prompt. To recap the main steps we covered:

First, open the Command Prompt application. This can be done by typing “cmd” in the Windows search bar or Run dialog.

The diskpart command provides a full overview of volumes and space. Type “diskpart” then “list volume” to see all volumes and their capacities.

The fsutil volume command shows free space on a particular drive letter. Type “fsutil volume diskfree C:” to view free space on C: drive.

The wmic command can retrieve disk information like size and free space. Type “wmic logicaldisk get size,freespace,caption” to see this for all disks.

The dir command shows free space on the current drive. Type “dir” in a folder on the target drive.

If having issues, check the command syntax and spelling of drive letters. Run as admin if access issues. Refer to your operating system’s help docs for more details on these commands.

For additional resources on checking disk space from the Windows command line, see:

[Insert 1-2 cited urls from sources provided]