Yes, you can quickly see how much free space is left on your computer's drives using the Command Prompt. The most direct and standard way to do this is by using the dir command combined with the /-c switch. This method works on all modern versions of Windows, from Windows 7 up to Windows 11. It provides a clear, text-based summary of each drive's capacity, used space, and available space without needing to open any graphical file explorer windows.
What You'll Need
- A computer running Microsoft Windows.
- Command Prompt. This is built into Windows and does not require any separate installation.
- A keyboard and mouse, or access to a touchscreen.
Step-by-Step
- Open Command Prompt. You can open it by searching for "cmd" in the Start menu. Click on the "Command Prompt" result that appears in the search list. Alternatively, you can press the Windows key, type
cmd, and press Enter. - Run the command. In the black window that appears, type the following command and press Enter:
dir /-c
- Read the output. The Command Prompt will now display a list of your computer's drives. For each drive, it will show the volume label (e.g., "Local Disk" or "Data Drive"), the total size of the drive, and the amount of free space remaining.
For example, the output might look like this:
Volume in drive C is Windows
Volume Serial Number is 12AB-34CD
Directory of C:\Users\YourName
10/25/2023 10:00 AM <DIR> .
10/25/2023 10:00 AM <DIR> ..
10/25/2023 10:00 AM 1,024 file.txt
1 File(s) 1,024 bytes
2 Dir(s) 100,000,000,000 bytes free
In this example, the last line confirms that there are 100,000,000,000 bytes of free space on the C drive. This number is in bytes, not gigabytes or megabytes, so the output can be very difficult to read for large drives. To fix this, you can use the wmic command, which provides a more readable summary.
- Run the WMIC command. In the same Command Prompt window, type the following command and press Enter:
wmic logicaldisk get size,freespace,caption
- Interpret the results. The output will be a table with three columns:
Size,Freespace, andCaption.
- Size: This is the total capacity of the drive in bytes.
- Freespace: This is the amount of available space in bytes.
- Caption: This is the drive label (e.g., "C:" or "D:").
For example, the output might look like this:
Caption FreeSpace Size
--------------- ------------ ------------
C: 10000000000 20000000000
D: 50000000000 100000000000
From this table, you can see that the C drive has 10,000,000,000 bytes (about 9.3 GB) of free space, and the D drive has 50,000,000,000 bytes (about 46.6 GB) of free space.
Common Mistakes
When using the Command Prompt to check disk space, there are a few common mistakes that can lead to confusion.
- Confusing Bytes with Gigabytes. The
dircommand displays the free space in bytes. For example,100,000,000,000bytes is not 100 gigabytes; it is roughly 93 gigabytes. To convert bytes to gigabytes, you must divide the number by1,073,741,824. This is a very common point of confusion for users. - Not using the
/-cswitch. If you simply typedirwithout the/-cswitch, the Command Prompt will display the free space in a different unit, such as kilobytes or megabytes, depending on the size of the drive. This can make the output even more difficult to read and interpret. - Running the command from the wrong folder. The
dircommand shows the free space of the current folder, not the entire drive. If you run the command from a specific folder, the output will only show the free space for that folder. To check the free space for the entire drive, you must run the command from the root directory of the drive. This is usually the case when you first open the Command Prompt, as it defaults to the current user's profile folder.
Tips
- Use the WMIC command for better readability. As mentioned in the steps above, the
wmic logicaldisk get size,freespace,captioncommand provides a much more readable summary of your disk space. It displays the results in a table format, making it easier to compare the sizes of different drives. - Use the pipe operator to filter output. You can use the pipe operator (
|) to filter the output of the WMIC command. For example, to see only the free space for the C drive, you can type the following command:
wmic logicaldisk get size,freespace,caption | find "C:"
- Save the results to a text file. You can save the output of the WMIC command to a text file for later reference. To do this, type the following command:
wmic logicaldisk get size,freespace,caption > disk_space.txt
This will create a file named disk_space.txt in the current directory containing the disk space information.
cleanmgr command. The cleanmgr command opens the Disk Cleanup utility, which can help you free up space on your drives by deleting temporary files and other unnecessary items. To use this command, type cleanmgr in the Command Prompt and press Enter.Troubleshooting
If the Command Prompt does not show the correct disk space, or if it gives you an error message, there are a few things you can try.
- Check if the Command Prompt is running with administrator privileges. Some commands require administrator privileges to run. If you are not running Command Prompt as an administrator, you may not be able to see the correct disk space for certain drives. To run Command Prompt as an administrator, right-click on the Command Prompt icon in the Start menu and select "Run as administrator".
- Check if the Command Prompt is running in a 32-bit environment. If you are running a 64-bit version of Windows on a 32-bit Command Prompt, you may not be able to see the correct disk space for the entire drive. This is because the 32-bit Command Prompt has a limited address space. To fix this, you must run the Command Prompt as an administrator.
- Check if the Command Prompt is running in a different language. The Command Prompt may display the drive labels in a different language than what you expect. This is because the Command Prompt uses the system language setting. To fix this, you can change the Command Prompt language by running the following command:
chcp 437
This command changes the code page to English (United States). If you are in a different region, you may need to use a different code page number.
reg add "HKCU\Control Panel\International" /v sShortDate /t REG_SZ /d "M/d/yyyy" /f
This command changes the short date format to the standard English format.
tzutil /s "Eastern Standard Time"
This command changes the time zone to Eastern Standard Time.
Frequently Asked Questions
Why does the Command Prompt show "0 bytes free"?
This usually means that the drive is completely full or that the Command Prompt does not have the necessary permissions to read the drive's information. Try running the Command Prompt as an administrator to see if that resolves the issue.
How do I convert the output from bytes to gigabytes?
To convert the number of bytes to gigabytes, you must divide the number by 1,073,741,824. For example, to convert 100,000,000,000 bytes to gigabytes, you would calculate 100,000,000,000 / 1,073,741,824 = 93.13 GB.
Does the Command Prompt show the free space for the entire drive or just the current folder?
The dir command shows the free space for the current folder, not the entire drive. To check the free space for the entire drive, you must run the command from the root directory of the drive. This is usually the case when you first open the Command Prompt, as it defaults to the current user's profile folder.
What is the difference between the dir command and the wmic command?
The dir command is a basic directory listing command that shows the files and folders in the current directory. The wmic command is a Windows Management Instrumentation command-line tool that provides information about the system's hardware and software, including disk space.
Can I use the Command Prompt to free up disk space?
Yes, you can use the cleanmgr command to open the Disk Cleanup utility, which can help you free up space on your drives by deleting temporary files and other unnecessary items.
What does the /-c switch do in the dir command?
The /-c switch tells the dir command to display the free space in bytes. Without this switch, the Command Prompt displays the free space in a different unit, such as kilobytes or megabytes, depending on the size of the drive.