Windows место на диске из командной строки

You can avoid the commas by using /-C on the DIR command.

FOR /F "usebackq tokens=3" %%s IN (`DIR C:\ /-C /-O /W`) DO (
    SET FREE_SPACE=%%s
)
ECHO FREE_SPACE is %FREE_SPACE%

If you want to compare the available space to the space needed, you could do something like the following. I specified the number with thousands separator, then removed them. It is difficult to grasp the number without commas. The SET /A is nice, but it stops working with large numbers.

SET EXITCODE=0
SET NEEDED=100,000,000
SET NEEDED=%NEEDED:,=%

IF %FREE_SPACE% LSS %NEEDED% (
    ECHO Not enough.
    SET EXITCODE=1
)
EXIT /B %EXITCODE%

UPDATE:

Much has changed since 2014. Here is a better answer. It uses PowerShell which is available on all currently supported Microsoft Windows systems.

The code below would be much clearer and easier to understand if the script were written in PowerShell without using cmd.exe as a wrapper. If you are using PowerShell Core, change powershell to pwsh.

SET "NEEDED=100,000,000"
SET "NEEDED=%NEEDED:,=%"

powershell -NoLogo -NoProfile -Command ^
    $Free = (Get-PSDrive -Name 'C').Free; ^
    if ($Free -lt [int64]%NEEDED%) { exit $true } else { exit $false }
IF ERRORLEVEL 1 (
    ECHO "Not enough disk space available."
) else (
    ECHO "Available disk space is adequate."
)

You can avoid the commas by using /-C on the DIR command.

FOR /F "usebackq tokens=3" %%s IN (`DIR C:\ /-C /-O /W`) DO (
    SET FREE_SPACE=%%s
)
ECHO FREE_SPACE is %FREE_SPACE%

If you want to compare the available space to the space needed, you could do something like the following. I specified the number with thousands separator, then removed them. It is difficult to grasp the number without commas. The SET /A is nice, but it stops working with large numbers.

SET EXITCODE=0
SET NEEDED=100,000,000
SET NEEDED=%NEEDED:,=%

IF %FREE_SPACE% LSS %NEEDED% (
    ECHO Not enough.
    SET EXITCODE=1
)
EXIT /B %EXITCODE%

UPDATE:

Much has changed since 2014. Here is a better answer. It uses PowerShell which is available on all currently supported Microsoft Windows systems.

The code below would be much clearer and easier to understand if the script were written in PowerShell without using cmd.exe as a wrapper. If you are using PowerShell Core, change powershell to pwsh.

SET "NEEDED=100,000,000"
SET "NEEDED=%NEEDED:,=%"

powershell -NoLogo -NoProfile -Command ^
    $Free = (Get-PSDrive -Name 'C').Free; ^
    if ($Free -lt [int64]%NEEDED%) { exit $true } else { exit $false }
IF ERRORLEVEL 1 (
    ECHO "Not enough disk space available."
) else (
    ECHO "Available disk space is adequate."
)

I’m trying to create a batch file to pull the total size and free space of the C:\ drive of servers (locally run script). I also need the output to be easily readable, so bytes is not going to work, so I’m ok with having a command line that creates a temp .vbs file.

The following seems like it could work, but the formatting/math isn’t correct.

setlocal
for /f "tokens=6" %a in ('fsutil volume diskfree C: ^| find "of bytes"') do set diskspace=%a
echo wsh.echo FormatNumber(cdbl(%diskspace%)/1024, 0) > %temp%.\tmp.vbs
for /f %a in ('cscript //nologo %temp%.\tmp.vbs') do set diskspace=%a
del %temp%.\tmp.vbs
echo For example %diskspace%

The above commands are also only showing free space… I would like total size too… Wondering if the following command might be better for pulling the info:

WMIC LOGICALDISK GET Name,Size,FreeSpace | find /i "C:"

Note also that I want this to be able to be copy/pasted directly into a command prompt (not a batch file — forced requirements). I’ve already removed the «%%»‘s from the code above.

Note: Needs to run natively on Server 2003+ (so Powershell is out, as well as any 3rd party utils).

asked Apr 1, 2015 at 16:41

BondUniverse's user avatar

BondUniverseBondUniverse

8235 gold badges14 silver badges27 bronze badges

2

Under the not a batch file — forced requirements clause, next cmd one-liner could help:

for /f "tokens=1-3" %a in ('WMIC LOGICALDISK GET FreeSpace^,Name^,Size ^|FINDSTR /I /V "Name"') do @echo wsh.echo "%b" ^& " free=" ^& FormatNumber^(cdbl^(%a^)/1024/1024/1024, 2^)^& " GiB"^& " size=" ^& FormatNumber^(cdbl^(%c^)/1024/1024/1024, 2^)^& " GiB" > %temp%\tmp.vbs & @if not "%c"=="" @echo( & @cscript //nologo %temp%\tmp.vbs & del %temp%\tmp.vbs

Output:

==>for /f "tokens=1-3" %a in ('WMIC LOGICALDISK GET FreeSpace^,Name^,Size ^|FIND
STR /I /V "Name"') do @echo wsh.echo "%b" ^& " free=" ^& FormatNumber^(cdbl^(%a^
)/1024/1024/1024, 2^)^& " GiB"^& " size=" ^& FormatNumber^(cdbl^(%c^)/1024/1024/
1024, 2^)^& " GiB" > %temp%\tmp.vbs & @if not "%c"=="" @echo( & @cscript //nolog
o %temp%\tmp.vbs & del %temp%\tmp.vbs

C: free=79,11 GiB size=111,45 GiB

D: free=929,47 GiB size=931,51 GiB

==>

answered Jun 7, 2015 at 20:03

JosefZ's user avatar

JosefZJosefZ

12.9k5 gold badges38 silver badges69 bronze badges

0

I realize you’re looking as VBS right now, but PowerShell can do this very easily:

$disk = Get-WmiObject Win32_LogicalDisk -Filter "DeviceID='C:'" | Select-Object Size, FreeSpace

Write-Host ("{0}GB total" -f [math]::truncate($disk.Size / 1GB))
Write-Host ("{0}GB free" -f [math]::truncate($disk.FreeSpace / 1GB))

First line gets the disk info from WMI (just does C: in this example), and selects just the Free Space and Total sizes.

In the next two lines write the Free Space and Total sizes to the console, formatted to be in GB, with fractions truncated off.

Example output (as-is):

223GB total
125GB free

answered Apr 1, 2015 at 16:56

Ƭᴇcʜιᴇ007's user avatar

Ƭᴇcʜιᴇ007Ƭᴇcʜιᴇ007

112k19 gold badges201 silver badges268 bronze badges

1

Divide by 1024 to get kibytes (2^10). Divide by 1024 x 1024 to get Mibytes (2^20). Divide by 1024 x 1024 x 1024 to get Gibytes (2^30).

Windows calls these units kilobytes, Megabytes, and Gigabytes for historical reasons. I think my casing is right.

So change your sums.

answered May 6, 2015 at 11:14

trigger's user avatar

In a batch file, you can get the disk size in GB of a specified disk by using a DiskPart script. In this example, I’m setting the specific disk index according to its model name (assuming there’s only one like it in the computer). Change the string «SATA Disk» to match your disk drive’s model. You can get the model name by running the command «wmic diskdrive get Model, Index» in cmd.

Of course, you can use a different property of the disk in the wmic command — type wmic diskdrive get /? to get a list of all disk properties you can use.

for /f %%I in ('wmic diskdrive get Model^, Index ^| find "SATA Disk"') do set DISK_Index=%%I

if not exist %~dp0Disk_Size.script (echo list disk > %~dp0Disk_Size.script)
@echo off
FOR /F "tokens=4 delims= " %%J in ('diskpart /s %~dp0Disk_Size.script ^| find "Disk %DISK_Index%"') do set DISK_SIZE=%%J
IF %ERRORLEVEL% EQU 1 (echo No Data was processed, cannot get DISK_SIZE)

echo DISK_SIZE is %DISK_SIZE% GB

answered Jul 16, 2017 at 10:02

Eric's user avatar

EricEric

393 bronze badges

If you just need to check if the drive have enough free space (to install or copy something for example) you can try wmic query like this:

wmic LogicalDisk where "DeviceID='c:' and FreeSpace > 10737418240" get DeviceID 2>&1 ^
| find /i "c:" >nul || (echo not enough space&exit 1)

this will break batch file execution if there is less than 10Gb free on C:

answered Feb 19, 2018 at 13:43

anilech's user avatar

You must log in to answer this question.

Not the answer you’re looking for? Browse other questions tagged

.

Вы тут: Главная Windows diskusage vs. dfp: анализ занятого места на диске из командной строки

В предновогодних инсайдерских сборках Windows 10 20277 и 21277 появилась консольная утилита diskusage для анализа дискового пространства. Сегодня я разберу некоторые нюансы работы новой утилиты и поделюсь с вами результатами ее испытаний в сравнении с утилитой dfp.

Предвосхищая вопрос, diskusage работает и в предыдущих версиях Windows 10, если перекинуть в них исполняемый файл и MUI-ресурсы (проверялось на 20H2).

[+] Сегодня в программе

Параметры командной строки и примеры команд

Утилита обладает развесистым списком ключей, причем в двух вариантах (для публикации я выбрал длинные, но понятные). Поскольку речь о предварительной версии, все может поменяться в будущем.

diskusage

Если путь не указан, по умолчанию утилита рекурсивно сканирует начиная с текущей папки. Отмечу, что я практически всегда использовал ключи /humanReadable /skipReparse помимо прочих. Первый отображает размеры в GB/MB нежели только в байтах, а второй я разберу ниже.

В справке не хватает примеров, но я восполню пробел этой статьей. Парочка для затравки:

  • Показать 25 самых больших папок на диске C.
    diskusage C:\ /TopDirectory=25 /humanReadable /skipReparse
  • Показать 30 самых больших файлов в папке Загрузки наряду с датой их создания.
    diskusage "%userprofile%\Downloads\" /TopFile=30 /displayFlag=0x080 /humanReadable /skipReparse

Отмечу несколько нюансов diskusage в сравнении с dfp, которая давно исключена из поставки Windows, хотя до сих пор прекрасно работает и входит в мой арсенал.

Определение размера системных файлов и зарезервированного пространства

Ключ /systemAndReserve. Логично было бы добавлять этот параметр к первоначальному сканированию системного диска, но пока ключ не срабатывает в сочетании с некоторыми другими. Если смотреть отдельно, то быстрее всего результат получается, если натравить утилиту на пустую папку.

diskusage C:\new /systemAndReserve /humanReadable
         SizeOnDisk                    Files  Directory path
                  0  (  0.0 KB)            0  C:\new
     20 293 710 083  ( 18.9 GB)           47  [System Files and Reserved Space]
168 317 841 408(156.8 GB)/254 588 350 464(156.8 GB)  66.1% of disk in use

Сведения отображаются в конце вывода. Утилита показывает 18.9GB. Это сильно расходится со сводкой в Параметрах, но картина проясняется при изучении подробностей.

diskusage

Судя по всему, значение складывается из размера зарезервированного пространства и теневых копий (точек восстановления). Объем зарезервированного пространства и так можно посмотреть из консоли с fsutil, см. статью по ссылке↑ А к теневым копиям я еще вернусь.

Переход по символическим ссылкам и соединениям

Утилита подсчитывает размер папок, в которые ведут символические ссылки и соединения. Это – поведение по умолчанию, а выключается оно ключом /skipReparse. На мой взгляд, стоило сделать наоборот. У меня при первом тестовом запуске diskusage полезла в теневые копии по ссылке, что сделало анализ бесполезным :)

Не самая ценная фича для анализа отдельно взятого диска, но сценарии под нее найдутся, наверное.

Подсчет размера только одной жесткой ссылки

Утилита dfp ведет себя так же. Однако diskusage умеет считать и размер всех жестких ссылок с ключом /allLinks. Большой практической ценности это не несет, но для исследований бывает полезно. Ниже я разверну этот тезис на примере.

Анализ файлов

Ключ /TopFile. Он позволяет выявить самые большие файлы. В утилите dfp для анализа на уровне файлов служит ключ /all.

Фильтры по именам и размерам

Ключи /nameFilter для имен и /minSizeOnDisk, /minFileSize для размеров папок. Другими словами, можно выводить папки и/или файлы, размер которых превышает заданный порог.

Топ-5 файлов размером более 10GB:

diskusage E:\Movies /minSizeOnDisk=10000000000 /TopFile=5 /humanReadable /skipReparse

Топ-5 файлов mp4:

diskusage E:\Movies /nameFilter=*.mp4 /TopFile=5 /humanReadable /skipReparse 

Вывод столбцов с датами создания, изменения и доступа

Ключ /displayFlag. Пример в начале статьи.


Пожалуй, последние три пункта в списке наиболее полезны на практике. Из остального отмечу вывод в формате CSV и параметры запуска в… INI-файле, в 2021 году:)

Замечу, что в отличие от dfp, в новой утилите нет снимков, позволяющих быстро выявлять повторно засоряющиеся папки.

Скорость работы и результаты анализа

Практическое сравнение показало высокую скорость работы diskusage и более осмысленные результаты.

У меня подход к анализу с dfp простой — сначала я рекурсивно анализирую топ-25 из корня диска, потом выбираю папки из топа для более пристального изучения. Это обусловлено тем, что при первом запуске много капитанства – корень диска, папки Windows, Users и т.д.

На моем системном диске занято 150GB. Первичный анализ dfp занял 111 секунд.

dfp /b /top 25 /elapsed /study {largest} C:\

Size On Disk    Files  Folders Path
      137.5G   658033   158499 C:\
       64.1G   226614    43550 C:\Users
       63.0G   217951    37544 C:\Users\Vadim
       34.1G     7360      426 C:\Users\Vadim\Downloads
       24.1G   301184    96431 C:\Windows
       15.9G   198613    34846 C:\Users\Vadim\AppData
       12.8G   174917    31220 C:\Users\Vadim\AppData\Local
       11.6G       31       17 C:\System Volume Information
       10.7G    97674    12828 C:\Program Files
       10.3G      695      328 C:\Users\Vadim\Documents
        9.8G    13018     3422 C:\ProgramData
        9.1G    76806    37420 C:\Windows\WinSxS
        8.1G     8510     2342 C:\ProgramData\Microsoft
        7.2G    82213     7694 C:\Program Files\WindowsApps
        6.9G    22553     3265 C:\Windows\System32
        6.8G    18443     2092 C:\Program Files (x86)
        5.7G       90      154 C:\Users\Vadim\Documents\WPR Files
        4.8G    29596     3568 C:\Users\Vadim\AppData\Local\Microsoft
        4.2G      945       85 C:\iso
        4.2G      861       71 C:\iso\sources
        4.1G        6        3 C:\Windows\LiveKernelReports
        4.1G     3572     1386 C:\ProgramData\Microsoft\Windows
        4.0G        3        4 C:\Users\Vadim\Documents\Virtual Machines
        4.0G        3        3 C:\Users\Vadim\Documents\Virtual Machines\Win10
        4.0G        3        1 C:\Users\Vadim\Documents\Virtual Machines\Win10\Virtual Machines

Схожий анализ diskusage занял 39 секунд.

diskusage C:\ /humanReadable /skipReparse /TopDirectory=25
        SizeOnDisk                    Files           SizePerDir              Directory path
     36 656 173 056  ( 34.1 GB)        7 360       28 660 928 512  ( 26.7 GB)  C:\Users\Vadim\Downloads
    136 884 260 864  (127.5 GB)      618 167        6 728 695 808  (  6.3 GB)  C:\
      6 164 135 936  (  5.7 GB)           90        5 904 556 032  (  5.5 GB)  C:\Users\Vadim\Documents\WPR Files
      4 390 891 520  (  4.1 GB)            6        4 389 044 224  (  4.1 GB)  C:\Windows\LiveKernelReports
      4 468 154 368  (  4.2 GB)          861        4 373 553 152  (  4.1 GB)  C:\iso\sources
      4 299 321 344  (  4.0 GB)            3        4 299 321 344  (  4.0 GB)  C:\Users\Vadim\Documents\Virtual Machines\Win10\Virtual Machines
      4 160 749 568  (  3.9 GB)            1        4 160 749 568  (  3.9 GB)  C:\ProgramData\Microsoft\Windows\Hyper-V\Virtual Machines\57269E6F-58C0-4826-AD96-76BAFDE889CD
      2 791 686 144  (  2.6 GB)            8        2 791 686 144  (  2.6 GB)  C:\Users\Vadim\Downloads\ODT\Office\Data\16.0.13231.20262
      2 416 443 392  (  2.3 GB)           35        2 416 443 392  (  2.3 GB)  C:\ProgramData\Microsoft\Diagnosis\ETLLogs
      2 470 723 584  (  2.3 GB)        1 135        2 361 192 448  (  2.2 GB)  C:\Users\Vadim\Downloads\Telegram Desktop
      1 773 436 928  (  1.7 GB)            2        1 773 436 928  (  1.7 GB)  C:\Users\Vadim\Music\playlists
      1 496 182 784  (  1.4 GB)          323        1 325 723 648  (  1.2 GB)  C:\Windows\Installer
      1 172 525 056  (  1.1 GB)            3        1 172 525 056  (  1.1 GB)  C:\Users\Vadim\AppData\Local\TechSmith\SnagIt\CrashDumps
      1 166 528 512  (  1.1 GB)           95        1 165 533 184  (  1.1 GB)  C:\ProgramData\Microsoft\Search\Data\Applications\Windows
      5 471 752 192  (  5.1 GB)       12 553          973 971 456  (928.9 MB)  C:\Windows\System32
        886 448 128  (845.4 MB)          894          886 448 128  (845.4 MB)  C:\Users\Vadim\AppData\Local\Microsoft\Office\16.0\OfficeFileCache
      1 780 797 440  (  1.7 GB)        3 020          863 371 264  (823.4 MB)  C:\Program Files (x86)\Microsoft Office\root\Office16
        773 963 776  (738.1 MB)           84          773 963 776  (738.1 MB)  C:\Windows\System32\DriverStore\FileRepository\nvlt.inf_amd64_5e2cc60b5ece0c53
        656 900 096  (626.5 MB)           34          656 896 000  (626.5 MB)  C:\Users\Vadim\AppData\Local\Microsoft\Windows\Explorer
        907 816 960  (865.8 MB)       60 964          608 763 904  (580.6 MB)  C:\Windows\servicing\LCU\Package_for_RollupFix~31bf3856ad364e35~amd64~~19041.685.1.6
        840 912 896  (802.0 MB)       59 081          593 412 096  (565.9 MB)  C:\Windows\servicing\LCU\Package_for_RollupFix~31bf3856ad364e35~amd64~~19041.662.1.10
        849 870 848  (810.5 MB)       55 488          573 169 664  (546.6 MB)  C:\Windows\servicing\LCU\Package_for_RollupFix~31bf3856ad364e35~amd64~~19041.630.1.6
        536 915 968  (512.0 MB)          568          521 830 400  (497.7 MB)  C:\Users\Vadim\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs\var\cache\apt\archives
        511 778 816  (488.1 MB)           88          511 778 816  (488.1 MB)  C:\Users\Vadim\OneDrive\Music
        524 681 216  (500.4 MB)          527          500 322 304  (477.1 MB)  C:\Windows\SoftwareDistribution\Download\baa66f28726f701d6508d16b26235240

Сопоставляя результаты, можно увидеть ряд совпадений. Но очевидно, что у diskusage вывод топ-25 лучше конкретизирован. Однако в нем есть и странности.

Например, dfp четко показывает размер папки System Volume Information с теневыми копиями. А diskusage в ней ничего не видит, поэтому в топе ее нет. Точнее, не видит от имени администратора, но прозревает при запуске от имени системы.

Дальнейшие эксперименты подтвердили, что diskusage не способна оценивать дисковое пространство в папках, в которые у администратора нет доступа.

Это существенно снижает ценность анализа, но пока спишем на предварительную версию.

Подсчет размера папок с учетом и без учета жестких ссылок

Размер папки WinSxS долго волновал умы пользователей Windows :) Постоянные читатели блога помнят мою разъяснительную работу с анализом хранилища компонентов. Повторюсь, что DISM фактически показывает объем папки Windows без учета и с учетом жестких ссылок (строки выделены).

Dism.exe /Online /Cleanup-Image /AnalyzeComponentStore

Component Store (WinSxS) information:

Windows Explorer Reported Size of Component Store : 9.94 GB

Actual Size of Component Store : 9.65 GB

    Shared with Windows : 5.64 GB
    Backups and Disabled Features : 4.01 GB
    Cache and Temporary Data :  0 bytes

Date of Last Cleanup : 2020-12-21 15:53:59

Number of Reclaimable Packages : 9
Component Store Cleanup Recommended : Yes

Утилита diskusage предлагает свой взгляд на этот вопрос. По умолчанию она считает размер только одного экземпляра жесткой ссылки, но с ключом /allLinks учитывает все экземпляры.

Ниже фрагмент вывода двух команд, анализирующих системный диск. В обоих случаях ключ /maxDepth=1 ограничивает глубину вывода одной папкой, т.е. показывает только папки в корне диска. Из результатов я убрал все кроме папки Windows.

diskusage C:\ /maxDepth=1 /humanReadable /skipReparse /TopDirectory=25
         SizeOnDisk                    Files  Directory path
     21 543 395 328  ( 20.1 GB)      263 633  C:\Windows

diskusage C:\ /maxDepth=1 /humanReadable /skipReparse /TopDirectory=25 /allLinks 
         SizeOnDisk                    Files  Directory path
     28 009 570 304  ( 26.1 GB)      300 827  C:\Windows

Утилита оценивает объем жестких ссылок в папке Windows в 26.1-20.1=6GB, что близко к оценке DISM в 5.64GB. Заодно мы видим количество жестких ссылок — утилита насчитала 37 194, что тоже полезно для исследований. В принципе, можно скриптовать перебор файлов с fsutil, и я когда-то такое делал, но с diskusage явно проще.

Заключение

Я в курсе, что многие читатели предпочитают для анализа дискового пространства приложения с графическим интерфейсом — WinDirStat, Scanner и прочие. Но консольные утилиты очень удобны для удаленной диагностики, а встроенные — незаменимы в ограниченной корпоративной среде. В моей практике dfp вытеснила Scanner даже в домашних условиях.

Причина выпиливания dfp из Windows 10 так и осталась загадкой. Теперь Microsoft возвращает в состав ОС полезный диагностический инструмент. Правда, в стабильную версию он, видимо, попадет только осенью 2021 года, но лучше поздно, чем никогда.

А чем пользуетесь вы?

Updated by
Cici on Aug 09, 2023 

The main purpose of this article is that EaseUS wants to teach you how to use CMD to check hard disk usage on Windows 10. Besides, this article gives a better way and easier way to check disk space on Windows 10. Read the table to get more information:

Features

🥇EaseUS Partition Master Free

🥈CMD

🎲Calculate the size of the hidden space Yes No
📁 Find duplicate files Yes No
❎ Delete files directly Yes No
🕑 Show the percentage of occupied space Yes No
💰 Free or Paid Free Free

What is taking up my space on my hard drive? Various things can take up space on your hard disk drive. The most common are files you download from the Internet or receive as e-mail attachments. These can include videos, photos, music files, and documents. Another common source of large files is applications you have installed on your computer. These can include programs such as Microsoft Office, Photoshop, and games. Finally, your hard drive may also be taking up space for temporary files that are created when you use programs or visit websites. Let’s read the tutorial below together and learn how to use CMD to get disk space usage.

Command Prompt is an interpreter application that commands most Windows operating systems to perform different tasks through various command lines. The Command Prompt is called the Windows Command Processor, but it is better known as the CMD. Before CMD checks disk space, you need to read the following to know whether this method is suitable for you:

Notice:

1. Command Prompt lists a huge number of hard drive space in MB, which is not very clear in GB or TB.

2. Command Prompt requires administrator privileges to help you view space usage.

3. The method of using CMD to check the total hard drive size is only recommended for advanced users. Novice users need to turn to CMD alternatives.

Well, now, if you are an experienced user, follow the guide below to learn how:

Step 1. Type Command Prompt in the search box on your Windows 10 PC.

Step 2. Select Command Prompt and click Run as Administrator.

Step 3. Type wmic diskdrive get size, and press Enter.

cmd to get disk space

💡Notice: Note that the result of this check is to calculate the disk space in MB: 1GB=1024MB. Based on your number. You can check it and change it to GB.

It can be difficult to check disk space using CMD, so if you are not an experienced user, turning to a reliable free disk space analyzer is a better choice. The benefits of using a third-party tool to check disk space are as follows:

✅Clear results will be displayed.

✅One-click locates and deletes the large files.

✅Easier to use without requiring any commands.

Check the best alternative to CMD to check the disk space. Click the link below to learn how to get disk space via PowerShell.

Read Also: PowerShell Get Disk Space

Best Alternative to CMD to Check Disk Space — EaseUS Partition Master Free

The best way to check the total disk space on Windows 10 is to turn to a professional disk space analyzer — EaseUS Partition Master Free. In addition to providing disk space, it can also show you the free and used space on the disk. It provides the percentage of each file on the disk, and you can use it to perform other operations after analyzing the disk space, such as deleting and cleaning up large files, etc.

Download this powerful tool for free:

Step 1. Launch EaseUS Partition Master and turn to Discovery. Find and Download Space Analyzer below Frequently Used Tools.

download space analyzer

Step 2. In the Space Analyzer pop-up window, select the target disk to be analyzed and click Analyze in the upper right corner.

click analyze

Step 3. Wait a while, and you will see the detailed data. You can click on Foler/File to view different data types and click on the small folder icon to see more information inside the file.

view the detailed data

When there is not enough space on your disk, you can try the following ways to free up hard drive space:

  • Extend disk partition
  • Delete unnecessary files and programs
  • Empty the trash can on your desktop
  • Enable Storage Sense

EaseUS Partition Master is a comprehensive disk space management tool that provides many additional features to help you improve hard disk performance and expand free space. Click on the links below to view the specific features described:

Conclusion

This article provides two efficient ways to help you analyze disk space on Windows 10. The command line can only check the total space and will not display the specific space usage. If you want to check disk usage, including hidden space, EaseUS Partition Master Free can provide faster and more accurate check results.

And this tool also allows you to expand the disk and solve the problem of low disk space by adjusting partitions, shrinking or extending partitions, cleaning files, etc. If you want to check your computer’s hard drive storage and usage, download it to help!

Check Disk Space Windows 10 CMD FAQs

CMD might be difficult to use if you don’t have much computing experience, so here are some other common issues you may like to know when you check disk space on Windows 11/10. Check the answers below to help:

1. Can wmic diskdrive get size command to show the disk space in GB?

No, you can check the total disk space in CMD by typing the command «wmic diskdrive get size.» But CMD will only show the total disk space with a huge number and the result in MB. So you need to change the MB into GB.

2. What’s the command to check disk space in Windows using PowerShell?

To check disk space in Windows, you can use PowerShell and type various commands:

  • Show all the drives and space allocation: Get-Volume
  • Show the free disk space of all drives: Get-PSDrive

However, PowerShell is not designed for beginners, so if you are a beginner in computing, turn to EaseUS Partition Master. Its «Disk Space Analyzer» feature can show all the disk space (Free and used). After analyzing the disk space, you can use this tool to delete, extend or shrink the target drive.

3. How to check SSD Storage in CMD?

SSD usually has limited disk space, so analyzing the disk space for an SSD is important. There are many ways to get SSD storage. For example, you can use CMD to know the total disk space of the SSD:

Step 1. Launch Command Prompt and run it as an administrator.

Step 2. Type the command in the CMD prompt:

wmic diskdrive get size

But if you want to analyze disk usage, turn to a reliable third-party disk space analyzer.

  • Windows который грузится с флешки
  • Windows какой процесс держит файл
  • Windows консоль права на папку
  • Windows комментарии в bat файле
  • Windows как читается на русском языке