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


  1. Posts : 1,777
    Windows 11 [21H2]
       #1271

    Paul Black said:
    I must admit that it did NOT have any great impact on my computer and took less than about 5 seconds [ other things were running ] to return the results.
    It also took less than 5 seconds on me.

    I will publish here later a CMD batch file that can run any codes (just make sure it's only one line) and measure its execution time.
      My Computers


  2. Posts : 18,044
    Win 10 Pro 64-bit v1909 - Build 18363 Custom ISO Install
       #1272

    Thanks @jbcarreon123.

    jbcarreon123 said:
    I will publish here later a CMD batch file that can run any codes (just make sure it's only one line) and measure its execution time.
    That sounds very interesting and will be VERY useful for those of us who dabble in Commands.
      My Computer


  3. Posts : 7,607
    Windows 10 Home 20H2
       #1273

    zbook said:
    Code:
    Microsoft Windows [Version 10.0.19043.1466]
    (c) Microsoft Corporation. All rights reserved.
    
    C:\WINDOWS\system32>powershell get-volume^|sort DriveLetter^|format-table @{l='Drive Letter';e={($_.DriveLetter)};align='Left'},@{l='Drive Label';e={($_.FileSystemLabel)};align='Left'},@{l='File System';e={($_.FileSystemType)}},@{l='Free Space';e={[math]::round($_.SizeRemaining / 1GB, 2, 00).ToString('#.00 GB')};a='Right'},@{l='Used Space';e={[Math]::Round(($_.Size - $_.SizeRemaining) / 1GB, 2, 00).ToString('#.00 GB')};a='Right'},@{l='Total Space';e={[math]::round($_.Size / 1GB, 2, 00).ToString('#.00 GB')};a='Right'},@{l='Free (%)';e={[math]::round(($_.sizeremaining / $_.size)*100, 2).ToString('0.00')};a='Right'}
    
    Drive Letter Drive Label     File System Free Space Used Space Total Space Free (%)
    ------------ -----------     ----------- ---------- ---------- ----------- --------
                 Recovery        NTFS           6.26 GB     .72 GB     6.98 GB    89.62
    C            Windows         NTFS         472.59 GB  216.57 GB   689.16 GB    68.57
    D            HP_TOOLS        FAT32          1.91 GB     .09 GB     2.00 GB    95.45
    G                            Unknown         .00 GB     .00 GB      .00 GB
    K            System Reserved NTFS            .45 GB     .04 GB      .49 GB    92.72
    
    
    
    C:\WINDOWS\system32>
    In the above output, the size unit is still "GB" even if the size is less than 1 GB, for example .04 GB.
    In the attached script, the size unit becomes "MB" if the size is less than 1 GB. See my example below:
    Code:
    
    Drive Letter Drive Label File System Free Space Used Space Total Space Free (%)
    ------------ ----------- ----------- ---------- ---------- ----------- --------
                 VTOYEFI     FAT            9.24 MB   22.50 MB    31.74 MB     29 %
                 Recovery    NTFS          83.69 MB  415.30 MB   499.00 MB     17 %
         C       Windows 10  NTFS          50.98 GB   29.42 GB    80.40 GB     63 %
         D       Data        NTFS         326.72 GB   58.04 GB   384.76 GB     85 %
         E       DEVICE      FAT32          7.03 GB  172.56 MB     7.20 GB     98 %
         F       EXTRA       FAT32         18.89 GB    1.98 GB    20.87 GB     91 %
         I       SD CARD 1   FAT32          1.80 GB   93.28 MB     1.89 GB     95 %
         K       SD CARD2    FAT32          1.75 GB   35.24 MB     1.79 GB     98 %
         L       Windows ISO NTFS           2.21 GB    5.79 GB     8.00 GB     28 %
         Y       Ventoy      exFAT         56.45 GB    3.55 GB    60.00 GB     94 %
         Z                                   .00 MB     .00 MB      .00 MB
    Post problem reports here for Batch files for use in BSOD debugging Attached Files
      My Computer


  4. Posts : 18,044
    Win 10 Pro 64-bit v1909 - Build 18363 Custom ISO Install
       #1274

    Hello @Matthew Wai,

    Matthew Wai said:
    In the above output, the size unit is still "GB" even if the size is less than 1 GB, for example .04 GB.
    In the attached script, the size unit becomes "MB" if the size is less than 1 GB . . .
    VERY NICE Matthew.

    I have compiled it into a single Command and added 2 Decimal points for anyone interested . . .

    Code:
    
    PowerShell "Get-volume | Sort DriveLetter | FT -A @{l='Drive Letter';E={($_.DriveLetter)};align='Left'}, @{l='Drive Label';E={($_.FileSystemLabel)};align='Left'}, @{l='File System';E={($_.FileSystem)}}, @{l='Free Space';E={;If ($_.SizeRemaining -lt 1073741824) {;[Math]::round($_.SizeRemaining / 1MB, 2, 00).ToString('#.00 MB')} else {;[Math]::round($_.SizeRemaining / 1GB, 2, 00).ToString('#.00 GB')}};A='Right'}, @{l='Used Space';E={;If ($_.Size - $_.SizeRemaining -lt 1073741824) {;[Math]::round(($_.Size - $_.SizeRemaining) / 1MB, 2, 00).ToString('#.00 MB')} else {;[Math]::round(($_.Size - $_.SizeRemaining) / 1GB, 2, 00).ToString('#.00 GB')}};A='Right'}, @{l='Total Space';E={;If ($_.Size -lt 1073741824) {;[Math]::round($_.Size / 1MB, 2, 00).ToString('#.00 MB')} else {;[Math]::round($_.Size / 1GB, 2, 00).ToString('#.00 GB')}};A='Right'}, @{l='Free (%)';E={;[Math]::round(($_.Sizeremaining / $_.Size)*100, 2).ToString('#.00') };A='Right'}"
    
    Drive Letter Drive Label     File System Free Space Used Space Total Space Free (%)
    ------------ -----------     ----------- ---------- ---------- ----------- --------
                 System Reserved NTFS         121.37 MB  457.63 MB   579.00 MB    20.96
    C            Win_10          NTFS          16.67 GB   13.36 GB    30.03 GB    55.52
    D            Data            NTFS           6.89 GB   10.89 GB    17.79 GB    38.76
    E                                            .00 MB     .00 MB      .00 MB
    S            System_Image    NTFS           6.04 GB  979.43 MB     7.00 GB    86.34
    
    
    
    
    
    
    
    
      My Computer


  5. Posts : 7,607
    Windows 10 Home 20H2
       #1275

    Paul Black said:
    added 2 Decimal points for anyone interested . . .
    I intentionally removed the decimal places because I thought they were unnecessary.
    Let the BSOD analysts decide whether to add or remove them.
      My Computer


  6. Posts : 1,777
    Windows 11 [21H2]
       #1276

    Paul Black said:
    Hello @Matthew Wai,


    VERY NICE Matthew.

    I have compiled it into a single Command and added 2 Decimal points for anyone interested . . .

    Code:
    
    PowerShell "Get-volume | Sort DriveLetter | FT -A @{l='Drive Letter';E={($_.DriveLetter)};align='Left'}, @{l='Drive Label';E={($_.FileSystemLabel)};align='Left'}, @{l='File System';E={($_.FileSystem)}}, @{l='Free Space';E={;If ($_.SizeRemaining -lt 1073741824) {;[Math]::round($_.SizeRemaining / 1MB, 2, 00).ToString('#.00 MB')} else {;[Math]::round($_.SizeRemaining / 1GB, 2, 00).ToString('#.00 GB')}};A='Right'}, @{l='Used Space';E={;If ($_.Size - $_.SizeRemaining -lt 1073741824) {;[Math]::round(($_.Size - $_.SizeRemaining) / 1MB, 2, 00).ToString('#.00 MB')} else {;[Math]::round(($_.Size - $_.SizeRemaining) / 1GB, 2, 00).ToString('#.00 GB')}};A='Right'}, @{l='Total Space';E={;If ($_.Size -lt 1073741824) {;[Math]::round($_.Size / 1MB, 2, 00).ToString('#.00 MB')} else {;[Math]::round($_.Size / 1GB, 2, 00).ToString('#.00 GB')}};A='Right'}, @{l='Free (%)';E={;[Math]::round(($_.Sizeremaining / $_.Size)*100, 2).ToString('#.00') };A='Right'}"
    
    Drive Letter Drive Label     File System Free Space Used Space Total Space Free (%)
    ------------ -----------     ----------- ---------- ---------- ----------- --------
                 System Reserved NTFS         121.37 MB  457.63 MB   579.00 MB    20.96
    C            Win_10          NTFS          16.67 GB   13.36 GB    30.03 GB    55.52
    D            Data            NTFS           6.89 GB   10.89 GB    17.79 GB    38.76
    E                                            .00 MB     .00 MB      .00 MB
    S            System_Image    NTFS           6.04 GB  979.43 MB     7.00 GB    86.34
    
    
    
    
    
    
    
    
    I will improve it.

    Matthew Wai said:
    I intentionally removed the decimal places because I thought they were unnecessary.
    Let the BSOD analysts decide whether to add or remove them.
    When I compiled the batch file to an single line, the 98 % becomes 9846 %%.
      My Computers


  7. Posts : 7,607
    Windows 10 Home 20H2
       #1277

    jbcarreon123 said:
    I compiled the batch file to an single line
    I intentionally separated the overly long line into multiple short lines because the long line drove me crazy.
      My Computer


  8. Posts : 1,777
    Windows 11 [21H2]
       #1278

    Paul Black said:
    Hello @Matthew Wai,


    VERY NICE Matthew.

    I have compiled it into a single Command and added 2 Decimal points for anyone interested . . .

    Code:
    
    PowerShell "Get-volume | Sort DriveLetter | FT -A @{l='Drive Letter';E={($_.DriveLetter)};align='Left'}, @{l='Drive Label';E={($_.FileSystemLabel)};align='Left'}, @{l='File System';E={($_.FileSystem)}}, @{l='Free Space';E={;If ($_.SizeRemaining -lt 1073741824) {;[Math]::round($_.SizeRemaining / 1MB, 2, 00).ToString('#.00 MB')} else {;[Math]::round($_.SizeRemaining / 1GB, 2, 00).ToString('#.00 GB')}};A='Right'}, @{l='Used Space';E={;If ($_.Size - $_.SizeRemaining -lt 1073741824) {;[Math]::round(($_.Size - $_.SizeRemaining) / 1MB, 2, 00).ToString('#.00 MB')} else {;[Math]::round(($_.Size - $_.SizeRemaining) / 1GB, 2, 00).ToString('#.00 GB')}};A='Right'}, @{l='Total Space';E={;If ($_.Size -lt 1073741824) {;[Math]::round($_.Size / 1MB, 2, 00).ToString('#.00 MB')} else {;[Math]::round($_.Size / 1GB, 2, 00).ToString('#.00 GB')}};A='Right'}, @{l='Free (%)';E={;[Math]::round(($_.Sizeremaining / $_.Size)*100, 2).ToString('#.00') };A='Right'}"
    
    Drive Letter Drive Label     File System Free Space Used Space Total Space Free (%)
    ------------ -----------     ----------- ---------- ---------- ----------- --------
                 System Reserved NTFS         121.37 MB  457.63 MB   579.00 MB    20.96
    C            Win_10          NTFS          16.67 GB   13.36 GB    30.03 GB    55.52
    D            Data            NTFS           6.89 GB   10.89 GB    17.79 GB    38.76
    E                                            .00 MB     .00 MB      .00 MB
    S            System_Image    NTFS           6.04 GB  979.43 MB     7.00 GB    86.34
    
    
    
    
    
    
    
    
    I improved it.

    Code:
    powershell "Get-volume | Sort DriveLetter | FT -A @{l="""Drive Letter""";E={;If ($_.DriveLetter -eq $NULL) {'Hidden'} else {($_.DriveLetter)}};align='Center'}, @{l='Drive Label';E={;If ($_.FileSystemLabel -eq '') {'NO LABEL'} else {($_.FileSystemLabel)}};align='left'}, @{l='File System';E={;If ($_.FileSystemType -eq '') {'Unknown'} else {($_.FileSystemType)}};align='center'}, @{l='Free Space';E={;If ($_.SizeRemaining -eq '0') {''} else {If ($_.Size -eq '0') {''} else {If ($_.SizeRemaining -lt 1073741824) {;[Math]::round($_.SizeRemaining / 1MB, 2, 00).ToString('#.00 MB')} else {;[Math]::round($_.SizeRemaining / 1GB, 2, 00).ToString('#.00 GB')}}}};A='Right'}, @{l='Used Space';E={;If ($_.SizeRemaining -eq '0') {''} else {If ($_.Size - $_.SizeRemaining -lt 1073741824) {;[Math]::round(($_.Size - $_.SizeRemaining) / 1MB, 2, 00).ToString('#.00 MB')} else {;[Math]::round(($_.Size - $_.SizeRemaining) / 1GB, 2, 00).ToString('#.00 GB')}}};A='Right'}, @{l='Total Space';E={;If ($_.Size -eq '0') {''} else {If ($_.Size -lt 1073741824) {;[Math]::round($_.Size / 1MB, 2, 00).ToString('#.00 MB')} else {;[Math]::round($_.Size / 1GB, 2, 00).ToString('#.00 GB')}}};A='Right'}, @{l='Free (%)';E={;[Math]::round(($_.Sizeremaining / $_.Size)*100, 2).ToString('#.00') };A='Right'}"
    Code:
    Microsoft Windows [Version 10.0.22000.434]
    (c) Microsoft Corporation. All rights reserved.
    
    ==============================
      jbcarreon123's CMD AutoRun
    ------------------------------
      PC Name: JB-PC
      RunAs Admin? False
      Windows Version:
      Microsoft Windows 11 Pro
    ==============================
    
    C:\Users\jbcarreon123>powershell "Get-volume | Sort DriveLetter | FT -A @{l="""Drive Letter""";E={;If ($_.DriveLetter -eq $NULL) {'Hidden'} else {($_.DriveLetter)}};align='Center'}, @{l='Drive Label';E={;If ($_.FileSystemLabel -eq '') {'NO LABEL'} else {($_.FileSystemLabel)}};align='left'}, @{l='File System';E={;If ($_.FileSystemType -eq '') {'Unknown'} else {($_.FileSystemType)}};align='center'}, @{l='Free Space';E={;If ($_.SizeRemaining -eq '0') {''} else {If ($_.Size -eq '0') {''} else {If ($_.SizeRemaining -lt 1073741824) {;[Math]::round($_.SizeRemaining / 1MB, 2, 00).ToString('#.00 MB')} else {;[Math]::round($_.SizeRemaining / 1GB, 2, 00).ToString('#.00 GB')}}}};A='Right'}, @{l='Used Space';E={;If ($_.SizeRemaining -eq '0') {''} else {If ($_.Size - $_.SizeRemaining -lt 1073741824) {;[Math]::round(($_.Size - $_.SizeRemaining) / 1MB, 2, 00).ToString('#.00 MB')} else {;[Math]::round(($_.Size - $_.SizeRemaining) / 1GB, 2, 00).ToString('#.00 GB')}}};A='Right'}, @{l='Total Space';E={;If ($_.Size -eq '0') {''} else {If ($_.Size -lt 1073741824) {;[Math]::round($_.Size / 1MB, 2, 00).ToString('#.00 MB')} else {;[Math]::round($_.Size / 1GB, 2, 00).ToString('#.00 GB')}}};A='Right'}, @{l='Free (%)';E={;[Math]::round(($_.Sizeremaining / $_.Size)*100, 2).ToString('#.00') };A='Right'}"
    
    Drive Letter Drive Label       File System Free Space Used Space Total Space Free (%)
    ------------ -----------       ----------- ---------- ---------- ----------- --------
       Hidden    NO LABEL             NTFS       85.09 MB  525.91 MB   611.00 MB    13.93
         C       Windows 11           NTFS       75.19 GB   35.90 GB   111.09 GB    67.69
         D       Data                 NTFS       82.46 GB   28.76 GB   111.22 GB    74.15
         E       NO LABEL            Unknown
         F       Test Volume [SSD]    NTFS      508.64 MB   53.36 MB   562.00 MB    90.51
         G       Ventoy               NTFS      178.62 MB   14.24 GB    14.41 GB     1.21
         H       NO LABEL            Unknown
         I       VTOYEFI               FAT        4.93 MB   26.80 MB    31.74 MB    15.54
    
    
    
    C:\Users\jbcarreon123>
    @Paul Black,
    Can't manage to fit the whole new command to my execution time.
    Code:
    C:\Users\jbcarreon123>D:\Check_CMD_EXE_Exec_Time.bat
    
    C:\Users\jbcarreon123>echo Command? or EXE name?
    Command? or EXE name?                                                                                                                                                                     C:\Users\jbcarreon123>echo Ex: PowerShell
    Ex: PowerShell                                                                                                                                                                            C:\Users\jbcarreon123>set /p "s1=>"
    >
    
    C:\Users\jbcarreon123>echo.
    
    
    C:\Users\jbcarreon123>echo Parameters?
    Parameters?
    
    C:\Users\jbcarreon123>echo Ex: -Command {Get-Disk}
    Ex: -Command {Get-Disk}
    
    C:\Users\jbcarreon123>set /p "s2=>"
    >
    
    C:\Users\jbcarreon123>echo.
    
    
    C:\Users\jbcarreon123>echo Start by pressing any key
    Start by pressing any key
    
    C:\Users\jbcarreon123>pause  1>nul
    
    C:\Users\jbcarreon123>for /F "tokens=1-4 delims=:.," %a in ("21:58:09.17") do (set /A "start=(((%a*60)+1%b % 100)*60+1%c % 100)*100+1%d % 100"  )
    
    C:\Users\jbcarreon123>(set /A "start=(((21*60)+158 % 100)*60+109 % 100)*100+117 % 100"  )
    
    C:\Users\jbcarreon123>set "timest=21:58:09.17"
    
    C:\Users\jbcarreon123>PowerShell "Get-volume | Sort DriveLetter | FT -A @{l="""Drive Letter""";E={;If ($_.DriveLetter -eq $NULL) {'Hidden'} else {($_.DriveLetter)}};align='Center'}, @{l='Drive Label';E={;If ($_.FileSystemLabel -eq '') {'NO LABEL'} else {($_.FileSystemLabel)}};align='left'}, @{l='File System';E={;If ($_.FileSystemType -eq '') {'Unknown'} else {($_.FileSystemType)}};align='center'}, @{l='Free Space';E={;If ($_.SizeRemaining -eq '0') {''} else {If ($_.Size -eq '0') {''} else {If ($_.SizeRemaining -lt 1073741824) {;[Math]::round($_.SizeRemaining / 1MB, 2, 00).ToString('#.00 MB')} else {;[Math]::round($_.SizeRemaining / 1GB, 2, 00).ToString('#.00 GB')}}}};A='Right'}, @{l='Used Space';E={;If ($_.SizeRemaining -eq '0') {''} else {If ($_.Size - $_.SizeRemaining -lt 1073741824) {;[Math]::round(($_.Size - $_.SizeRemaining) / 1MB, 2, 00).ToString('#.00 MB')} else {;[Math]::round(($_.Size - $_.SizeRemaining) / 1GB, 2, 00).ToString('#.00 GB')}}};A='Right'}, @{l='Total Space';E={;If ($_.Size -eq '0') {''} else {If ($_.Size -lt 10737418
    Missing closing ')' after expression in 'If' statement.
        + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
        + FullyQualifiedErrorId : MissingEndParenthesisAfterStatement
    
    
    C:\Users\jbcarreon123>set "timef=21:58:09.54"
    
    C:\Users\jbcarreon123>rem Get end time:
    
    C:\Users\jbcarreon123>rem Get end time:
    
    C:\Users\jbcarreon123>for /F "tokens=1-4 delims=:.," %a in ("21:58:09.54") do (set /A "end=(((%a*60)+1%b % 100)*60+1%c % 100)*100+1%d % 100"  )
    
    C:\Users\jbcarreon123>(set /A "end=(((21*60)+158 % 100)*60+109 % 100)*100+154 % 100"  )
    
    C:\Users\jbcarreon123>rem Get elapsed time:
    
    C:\Users\jbcarreon123>set /A elapsed=end-start
    
    C:\Users\jbcarreon123>rem Show elapsed time:
    
    C:\Users\jbcarreon123>set /A hh=elapsed/(60*60*100), rest=elapsed%(60*60*100), mm=rest/(60*100), rest%=60*100, ss=rest/100, cc=rest%100
    
    C:\Users\jbcarreon123>if 0 LSS 10 set mm=00
    
    C:\Users\jbcarreon123>if 0 LSS 10 set ss=00
    
    C:\Users\jbcarreon123>if 37 LSS 10 set cc=037
    
    C:\Users\jbcarreon123>echo.
    
    
    C:\Users\jbcarreon123>echo The Runtime is:
    The Runtime is:
    
    C:\Users\jbcarreon123>echo 00 Minutes
    00 Minutes
    
    C:\Users\jbcarreon123>echo 00 Seconds
    00 Seconds
    
    C:\Users\jbcarreon123>echo.
    
    
    C:\Users\jbcarreon123>echo Press any key to exit.
    Press any key to exit.
    
    C:\Users\jbcarreon123>
    But I managed to make this:
    Code:
    C:\Users\jbcarreon123>D:\Check_CMD_EXE_Exec_Time.bat
    Command? or EXE name?
    Ex: PowerShell
    >cmd
    
    Parameters?
    Ex: -Command {Get-Disk}
    >/c dir
    
    Start by pressing any key
    
    ==============================
      jbcarreon123's CMD AutoRun
    ------------------------------
      PC Name: JB-PC
      RunAs Admin? False
      Windows Version:
      Microsoft Windows 11 Pro
    ==============================
     Volume in drive C is Windows 11
     Volume Serial Number is 6229-FA50
    
     Directory of C:\Users\jbcarreon123
    
    01/21/2022  05:30 PM    <DIR>          .
    01/09/2022  04:08 AM    <DIR>          ..
    01/22/2022  05:47 PM    <DIR>          .elevenclock
    01/09/2022  09:13 PM    <DIR>          .VirtualBox
    01/09/2022  04:07 AM    <DIR>          Contacts
    01/11/2022  01:04 PM           295,290 eventlog.txt
    01/09/2022  04:07 AM    <DIR>          Favorites
    01/11/2022  10:28 PM             1,014 File2EXE.bat
    01/11/2022  09:55 PM               858 File2EXE.bat.bak
    01/09/2022  04:07 AM    <DIR>          Links
    01/09/2022  04:07 AM    <DIR>          Music
    01/11/2022  12:01 PM    <DIR>          OneDrive
    01/08/2022  08:41 PM    <DIR>          Pictures
    01/09/2022  04:07 AM    <DIR>          Saved Games
    01/08/2022  08:44 PM    <DIR>          Searches
    11/30/2021  11:47 AM            23,145 Tuneup_plus_log.bat
    01/12/2022  06:20 PM    <DIR>          Videos
    01/09/2022  09:10 PM    <DIR>          VirtualBox VMs
                   4 File(s)        320,307 bytes
                  14 Dir(s)  80,732,180,480 bytes free
    
    The Runtime is:
    00 Minutes
    00 Seconds
    
    Press any key to exit.
    
    C:\Users\jbcarreon123>
    Check_CMD_EXE_Exec_Time.bat

    Feel free to publish this to Batch Scripts / Programs.
      My Computers


  9. Posts : 18,044
    Win 10 Pro 64-bit v1909 - Build 18363 Custom ISO Install
       #1279

    jbcarreon123 said:
    When I compiled the batch file to an single line, the 98 % becomes 9846 %%.
    Yes, I had a problem with the %, I got round it by doubling up the percentage sign [ Escape ] and changing the formula slightly.

    I hope this helps.
      My Computer


  10. Posts : 18,044
    Win 10 Pro 64-bit v1909 - Build 18363 Custom ISO Install
       #1280

    Hello @jbcarreon123,

    jbcarreon123 said:
    I improved it.

    Code:
    Microsoft Windows [Version 10.0.22000.434]
    (c) Microsoft Corporation. All rights reserved.
    
    ==============================
      jbcarreon123's CMD AutoRun
    ------------------------------
      PC Name: JB-PC
      RunAs Admin? False
      Windows Version:
      Microsoft Windows 11 Pro
    ==============================
    
    C:\Users\jbcarreon123>powershell "Get-volume | Sort DriveLetter | FT -A @{l="""Drive Letter""";E={;If ($_.DriveLetter -eq $NULL) {'Hidden'} else {($_.DriveLetter)}};align='Center'}, @{l='Drive Label';E={;If ($_.FileSystemLabel -eq '') {'NO LABEL'} else {($_.FileSystemLabel)}};align='left'}, @{l='File System';E={;If ($_.FileSystemType -eq '') {'Unknown'} else {($_.FileSystemType)}};align='center'}, @{l='Free Space';E={;If ($_.SizeRemaining -eq '0') {''} else {If ($_.Size -eq '0') {''} else {If ($_.SizeRemaining -lt 1073741824) {;[Math]::round($_.SizeRemaining / 1MB, 2, 00).ToString('#.00 MB')} else {;[Math]::round($_.SizeRemaining / 1GB, 2, 00).ToString('#.00 GB')}}}};A='Right'}, @{l='Used Space';E={;If ($_.SizeRemaining -eq '0') {''} else {If ($_.Size - $_.SizeRemaining -lt 1073741824) {;[Math]::round(($_.Size - $_.SizeRemaining) / 1MB, 2, 00).ToString('#.00 MB')} else {;[Math]::round(($_.Size - $_.SizeRemaining) / 1GB, 2, 00).ToString('#.00 GB')}}};A='Right'}, @{l='Total Space';E={;If ($_.Size -eq '0') {''} else {If ($_.Size -lt 1073741824) {;[Math]::round($_.Size / 1MB, 2, 00).ToString('#.00 MB')} else {;[Math]::round($_.Size / 1GB, 2, 00).ToString('#.00 GB')}}};A='Right'}, @{l='Free (%)';E={;[Math]::round(($_.Sizeremaining / $_.Size)*100, 2).ToString('#.00') };A='Right'}"
    
    Drive Letter Drive Label       File System Free Space Used Space Total Space Free (%)
    ------------ -----------       ----------- ---------- ---------- ----------- --------
       Hidden    NO LABEL             NTFS       85.09 MB  525.91 MB   611.00 MB    13.93
         C       Windows 11           NTFS       75.19 GB   35.90 GB   111.09 GB    67.69
         D       Data                 NTFS       82.46 GB   28.76 GB   111.22 GB    74.15
         E       NO LABEL            Unknown
         F       Test Volume [SSD]    NTFS      508.64 MB   53.36 MB   562.00 MB    90.51
         G       Ventoy               NTFS      178.62 MB   14.24 GB    14.41 GB     1.21
         H       NO LABEL            Unknown
         I       VTOYEFI               FAT        4.93 MB   26.80 MB    31.74 MB    15.54
    I REALLY like the addition of the Hidden and NO LABEL entries. That suits my OCD to no end.

    I will have a look at the .bat file later, and I am sure that others will also benefit.
      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 03:38.
Find Us




Windows 10 Forums