wmic logicaldisk get size,freespace,caption

wmic logicaldisk get size,freespace,caption
  • 1.

Caption  FreeSpace    Size
C:       66594897920  277158555648
E:       47003512832  214747312128
N:       6186729472   61873324032

The wmic command outputs disk sizes in bytes, but you can use a PowerShell command to get the disk usage in a more human-readable format, such as MB or GB.

Powershell

Get-PSDrive -PSProvider FileSystem | ForEach-Object {
    $size = $_.Used + $_.Free
    $used = $_.Used
    $free = $_.Free

    [PSCustomObject]@{
        Name    = $_.Name
        "Size(GB)"  = [math]::round($size / 1GB, 2)
        "Used(GB)"  = [math]::round($used / 1GB, 2)
        "Free(GB)"  = [math]::round($free / 1GB, 2)
    }
}
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.

windows disk sizes, wmic, Get-PSDrive_PowerShell