DrvSpace.btm for your use, amuse, and/or comments

  • This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
Jun 11, 2008
14
1
62
Washington,DC
#1
For it to look right you will need your Options>Take Command>Tabs font set to terminal or similar because it uses ASCII boxes. I started this back in 2001 and it has developed since. The most recent addition be the volume labels and serial numbers.

Hope someone likes it.

Code:
::   Written by Robin Douglas
::   This bat file shows both graphical and numeric values for Total,
::   Used and Free drive space for all local hard drives, removable and
::   CD drives.  The main difference between this and other programs/bat's
::   of it's type is that the graphical display shows relative drive space.

@echo off
setlocal

:Main
    set r=3
    set FB=°
    set UB=Û
    set x=0

    set DriveLetters=C D E F G H I J K L M N O P Q R S T U V W X Y Z
    set Drives=%@substr[%DriveLetters,0,%@index[%DriveLetters,Z]]
    if %@right[1,%Drives] != Z set Drives=%Drives

    for %a in (%Drives) if %@ready[%a]==1 (echo %a %+ set DT=%@comma[%@disktotal[%a:,b]] %+ if %DT gt %b set b=%DT)
    set DrvUnit=%@eval[%b/50=2.4]
    set z=%DrvUnit
cls
    for %a in (%Drives) if %@ready[%a]==1 gosub Output

:Footer

    set TDPU=%@eval[%TDPU / %pd=.2]
    set TDPF=%@eval[%TDPF / %pd=.2]

    scrput %@dec[%r] 0 bla on whi     ÌÍÍÍÍÍÍØÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍØÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍØÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍØÍÍÍÍÍÍÍØÍÍÍÍÍÍÍØÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÍÍÍÍ͹
    scrput %r 0 bla on whi            º      ³                  ³                  ³                  ³       ³       ³                            º
    scrput %r 2 bla on whi total
    scrput %r %@eval[26-%@len[%TDT]] bla on whi %TDT
    scrput %r %@eval[45-%@len[%TDU]] mag on whi %TDU
    scrput %r %@eval[64-%@len[%TDF]] blu on whi %TDF
    scrput %r %@eval[71-%@len[%TDPU]] mag on whi %TDPU%%=%
    scrput %r %@eval[79-%@len[%TDPF]] blu on whi %TDPF%%=%

    set r=%@inc[%r]
    scrput %r 0 bla on whi            ÌÍÍÍÍÍÍÏÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÍÍÏÍÍÍÍÍÍÍÏÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹
    scrput %@eval[%r+1] 0 bla on whi  º   = Used Block     = Free Block   One Block ÷                                                              º
    scrput %@eval[%r+1] 2 red on whi Û
    scrput %@eval[%r+1] 19 red on whi °
    scrput %@eval[%r+1] 48 bla on whi %@comma[%DrvUnit] bytes
    scrput %@eval[%r+2] 0 bla on whi  ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
    screen %@eval[%r+3] 0
    echo.

:Done
    pause Do that key thing. (press any key when ready)
    quit
    exit

:: **********************************************************************************

:Output

    set DType=%@drivetypeex[%a]
    if %DType = 2 set DType=Remov
    if %DType = 3 set DType=HDD
    if %DType = 4 set DType=NetWk
    if %DType = 5 set DType=CD
    if %DType = 6 set DType=RAM
    if %DType = 7 set DType=DVD

    set DrvT=%@comma[%@disktotal[%a:,b]]
    set DrvU=%@comma[%@diskused[%a:,b]]
    set DrvF=%@comma[%@diskfree[%a:,b]]
    set DrvP=%@comma[%@eval[%DrvT/100]]
    set DrvPU=%@comma[%@eval[%DrvU/%DrvP=.2]]
    set DrvPF=%@comma[%@eval[%DrvF/%DrvP=.2]]

    set UD=%@eval[%@diskused[%a:,b]+(%DrvUnit/25)]
    set TD=%@eval[%@diskTotal[%a:,b]+(%DrvUnit/25)]

    if %x lt 1 scrput 0 0 bla on whi  ÉÍÍÍÍÍÍÑÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÑÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÑÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÑÍÍÍÍÍÍÍÑÍÍÍÍÍÍÍÑÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÑÍÍÍÍÍÍÍÍÍÍ»
    if %x lt 1 scrput 1 0 bla on whi  º Drv  ³ Total            ³ Used             ³ Free             ³ %=%Used ³ %=%Free ³ Label           ³ Serial # º
    if %x lt 1 scrput 2 0 bla on whi  ÌÍÍÍÍÍÍØÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍØÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍØÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍØÍÍÍÍÍÍÍØÍÍÍÍÍÍÍØÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍØÍÍÍÍÍÍÍÍÍ͹

    scrput %r 0 bla on whi            º      ³                  ³                  ³                  ³       ³       ³                 ³          º
    scrput %r 3 bla on whi %a:
    scrput %r %@eval[26-%@len[%DrvT]] bla on whi %DrvT
    scrput %r %@eval[45-%@len[%DrvU]] mag on whi %DrvU
    scrput %r %@eval[64-%@len[%DrvF]] blu on whi %DrvF
    scrput %r %@eval[71-%@len[%DrvPU]] mag on whi %DrvPU%%=%
    scrput %r %@eval[79-%@len[%DrvPF]] blu on whi %DrvPF%%=%
    scrput %r 82 bla on whi %@label[%a]
    scrput %r 100 bla on whi %@serial[%a]

    set r=%@inc[%r]
    scrput %r 0 bla on whi            º      ³                  ³                  ³                  ³       ³       ³                 ³          º
    scrput %r 2 bri whi on whi %DType

    set c=8
    do while %z le %UD
    scrput %r %c red on whi %UB
    set z=%@eval[%z+%DrvUnit]
    set c=%@inc[%c]
    enddo

    do while %z le %TD
    scrput %r %c red on whi %FB
    set z=%@eval[%z+%DrvUnit]
    set c=%@inc[%c]
    enddo

    set r=%@inc[%r]
    scrput %r 0 bla on whi            ÌÍÍÍÍÍÍØÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍØÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍØÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍØÍÍÍÍÍÍÍØÍÍÍÍÍÍÍØÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍØÍÍÍÍÍÍÍÍÍ͹

    set r=%@inc[%r]
    set x=%@inc[%x]
    set z=%DrvUnit
    set c=15

    set pd=%@INC[%pd]
    set DrvT=%@comma[%@disktotal[%a:,b]]
    set DrvU=%@comma[%@diskused[%a:,b]]
    set DrvF=%@comma[%@diskfree[%a:,b]]
    set DrvP=%@comma[%@eval[%DrvT/100]]
    set DrvPU=%@comma[%@eval[%DrvU/%DrvP=.2]]
    set DrvPF=%@comma[%@eval[%DrvF/%DrvP=.2]]

    set TDT=%@comma[%@eval[%TDT + %DrvT]]
    set TDU=%@comma[%@eval[%TDU + %DrvU]]
    set TDF=%@comma[%@eval[%TDF + %DrvF]]
    set TDPU=%@comma[%@eval[%TDPU + %DrvPU]]
    set TDPF=%@comma[%@eval[%TDPF + %DrvPF]]

    return
Here's a picture
 
Last edited: