foxidrive wrote:einstein1969 wrote:How many Tb have the bigger?
2 decimal places should cater for realistic sized spanned drives. IE: 1 to 99
In GB:
freespace.cmd:
Code: Select all
@echo off & setlocal EnableDelayedExpansion
set Width=20
rem remove comment for small size
rem set small=1
if defined small (set cs=Ü.) else set cs=Û°
For /L %%N in (0,1,%width%) do (set "Full=!Full!!cs:~0,1!" & set "Empt=!Empt!!cs:~1!" & set "Space=!Space! ")
echo( !Space:~0,%Width%! Used Free Tot
for /f "skip=1 tokens=1-3" %%a in ('wmic logicaldisk get deviceid^,FreeSpace^,Size') do (
set disk=%%a
if "!disk:~1!"==":" (
If not defined small echo(
if not "%%c"=="" (
call :ConvertGb TGB %%c
call :ConvertGb FGB %%b
set /a UGB=TGB-FGB, Ratio=FGB*Width/TGB, RR=Width-Ratio
for %%d in (UGB FGB TGB) do call :pad %%d
for %%r in (!Ratio!) do for %%p in (!RR!) do echo %%a !Full:~0,%%p!!Empt:~0,%%r! [!UGB! !FGB! !TGB!] GB
) else echo(%%a N/D
)
)
goto :eof
:ConvertGb retvat Bytes rem 2decimal from 0,01GB to 102400,00GB (100TB)
set "tmp=%~200"
if "!tmp:~9,1!"=="" (set %1=0) else (set /a t=!tmp:~0,-9!, %1=t-t/10+t/30-t/400+t/2000-t/90000+t/2200000)
goto :eof
:pad var rem pad until 98TB for optimizing space char
set tmp=!%1!
set tmp= !tmp:~0,-2!.!tmp:~-2!
set tmp=!tmp:~-8!
set %1=!tmp: .=0.!
goto :eof
I add small size:
Code: Select all
Used Free Tot
C: ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄..... [ 5.70 2.29 7.99] GB
D: ▄▄.................. [ 0.48 4.39 4.87] GB
E: ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄... [ 45.35 8.34 53.69] GB
F: ▄▄▄▄▄............... [ 1.65 6.35 8.00] GB
G: N/D
Einstein1969