Post problem reports here for Batch files for use in BSOD debugging


  1. Posts : 7,606
    Windows 10 Home 20H2
       #1241

    Try:

    PowerShell Get-Volume^|?{$_.Size}^|Sort DriveLetter^|FT -A

    It is possible to calculate the percentage of free space via additional commands.
    Last edited by Matthew Wai; 21 Jan 2022 at 00:20.
      My Computer


  2. Posts : 41,454
    windows 10 professional version 1607 build 14393.969 64 bit
       #1242

    The prior commands did not display results for the recovery partition:

    Code:
    Microsoft Windows [Version 10.0.19043.1466]
    (c) Microsoft Corporation. All rights reserved.
    
    C:\WINDOWS\system32>PowerShell Get-Volume^|Select DriveLetter, Size, SizeRemaining^|?{$_.Size}^|?{$_.DriveLetter}^|Sort DriveLetter
    
    DriveLetter         Size SizeRemaining
    -----------         ---- -------------
              C 739976933376  507492831232
              D   2147483648    2049859584
              K    523235328     485167104
    
    
    
    C:\WINDOWS\system32>PowerShell [System.IO.DriveInfo]::GetDrives^(^)^|Select Name, TotalSize, AvailableFreeSpace, VolumeLabel^|?{$_.TotalSize}
    
    Name    TotalSize AvailableFreeSpace VolumeLabel
    ----    --------- ------------------ -----------
    C:\  739976933376       507492438016 Windows
    D:\    2147483648         2049859584 HP_TOOLS
    K:\     523235328          485167104 System Reserved
    
    
    
    C:\WINDOWS\system32>PowerShell Get-Volume^|?{$_.Size}^|Sort DriveLetter^|FT -A
    
    DriveLetter FriendlyName    FileSystemType DriveType HealthStatus OperationalStatus SizeRemaining      Size
    ----------- ------------    -------------- --------- ------------ ----------------- -------------      ----
                Recovery        NTFS           Fixed     Healthy      OK                      6.26 GB   6.98 GB
    C           Windows         NTFS           Fixed     Healthy      OK                    472.62 GB 689.16 GB
    D           HP_TOOLS        FAT32          Fixed     Healthy      OK                      1.91 GB      2 GB
    K           System Reserved NTFS           Fixed     Healthy      OK                    462.69 MB    499 MB
    
    
    
    C:\WINDOWS\system32>
      My Computer


  3. Posts : 7,606
    Windows 10 Home 20H2
       #1243

    The following will display a device whose size is "0 B".

    PowerShell Get-Volume^|Sort DriveLetter^|FT -A

    A dysfunctional device's storage size could be "0 B".
    My empty DVD drive's storage size is "0 B".
    My empty card reader's storage size is "0 B".
      My Computer


  4. Posts : 41,454
    windows 10 professional version 1607 build 14393.969 64 bit
       #1244

    Code:
    Microsoft Windows [Version 10.0.19043.1466]
    (c) Microsoft Corporation. All rights reserved.
    
    C:\WINDOWS\system32>fsutil volume diskfree C:
    Total free bytes        : 507,466,088,448 (472.6 GB)
    Total bytes             : 739,976,933,376 (689.2 GB)
    Total quota free bytes  : 507,466,088,448 (472.6 GB)
    
    
    C:\WINDOWS\system32>fsutil volume diskfree d:
    A local NTFS volume is required for this operation.
    Total free bytes        : 2,049,859,584 (1.9 GB)
    Total bytes             : 2,147,483,648 (2.0 GB)
    Total quota free bytes  : 2,049,859,584 (1.9 GB)
    
    C:\WINDOWS\system32>fsutil volume diskfree k:
    Total free bytes        : 485,167,104 (462.7 MB)
    Total bytes             : 523,235,328 (499.0 MB)
    Total quota free bytes  : 485,167,104 (462.7 MB)
    
    C:\WINDOWS\system32>


    Can you create a command that displays results in GB? for all drives? whether they do or do not have designated drive letters?
      My Computer


  5. Posts : 41,454
    windows 10 professional version 1607 build 14393.969 64 bit
       #1245

    Code:
    Microsoft Windows [Version 10.0.19043.1466]
    (c) Microsoft Corporation. All rights reserved.
    
    C:\WINDOWS\system32>PowerShell Get-Volume^|Sort DriveLetter^|FT -A
    
    DriveLetter FriendlyName    FileSystemType DriveType HealthStatus OperationalStatus SizeRemaining      Size
    ----------- ------------    -------------- --------- ------------ ----------------- -------------      ----
                Recovery        NTFS           Fixed     Healthy      OK                      6.26 GB   6.98 GB
    C           Windows         NTFS           Fixed     Healthy      OK                    472.61 GB 689.16 GB
    D           HP_TOOLS        FAT32          Fixed     Healthy      OK                      1.91 GB      2 GB
    G                           Unknown        CD-ROM    Healthy      Unknown                     0 B       0 B
    K           System Reserved NTFS           Fixed     Healthy      OK                    462.69 MB    499 MB
    
    
    
    C:\WINDOWS\system32>
      My Computer


  6. Posts : 7,606
    Windows 10 Home 20H2
       #1246

    zbook said:
    It was not possible to display %free?
    Run the following one line of commands from Command Prompt.
    Code:
    PowerShell Get-WmiObject win32_logicaldisk -computername %ComputerName%^|Select Name,VolumeName,Freespace,Size,@{Name='Free %';Expression={[math]::round(($_.freespace / $_.size)*100, 2)}}^|FT -A



    zbook said:
    If there were a MBR drive with 4 TB would it display available free space up to 2 TB or 4 TB for the free space?
    allocated versus unallocated?
    I am not knowledgeable enough to answer the questions.
      My Computer


  7. Posts : 41,454
    windows 10 professional version 1607 build 14393.969 64 bit
       #1247

    It skipped the recovery partition (no drive letter):

    Code:
    Microsoft Windows [Version 10.0.19043.1466]
    (c) Microsoft Corporation. All rights reserved.
    
    C:\WINDOWS\system32>PowerShell Get-WmiObject win32_logicaldisk -computername %ComputerName%^|Select Name,VolumeName,Freespace,Size,@{Name='Free %';Expression={[math]::round(($_.freespace / $_.size)*100, 2)}}^|FT -A
    
    Name VolumeName         Freespace         Size Free %
    ---- ----------         ---------         ---- ------
    C:   Windows         507475628032 739976933376  68.58
    D:   HP_TOOLS          2049859584   2147483648  95.45
    G:
    K:   System Reserved    485167104    523235328  92.72
    
    
    
    C:\WINDOWS\system32>
      My Computer


  8. Posts : 7,606
    Windows 10 Home 20H2
       #1248

    zbook said:
    It skipped the recovery partition (no drive letter):
    I am unable to fix it.
      My Computer


  9. Posts : 41,454
    windows 10 professional version 1607 build 14393.969 64 bit
       #1249

    Ideally the commands/results would display:

    a) all drives (whether they do or do not have designated drive letters)
    b) drive size in GB
    c) free space in GB
    d) % free
      My Computer


  10. Posts : 7,606
    Windows 10 Home 20H2
       #1250

    Ideally, you should turn to an expert instead of me.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 22:00.
Find Us




Windows 10 Forums