I like this one, should be fast enough (tested with some HDDs, USBremovable and 1 optical drive (I have no floppy drive).
Code:
alias -l sub.drives {
  ; cycle drives
  if ($1 == begin) {
    var %asc = 99
    while (%asc <= 122) {
      if ($disk($chr(%asc))) {
        var %d = $upper($chr(%asc))
        ; store sums of fixed/removable drives
        if ($istok(fixed removable,$disk(%d).type,32)) {
          set -u %sub.drive.list $addtok(%sub.drive.list,%d 1 $disk(%d).size $disk(%d).free,124)
          inc -u %sub.drive.total $disk(%d).size
          inc -u %sub.drive.free $disk(%d).free
        }
        ; other drives: store only type
        else { set -u %sub.drive.list $addtok(%sub.drive.list,%d $disk(%d).type 0 0,124) }
      }
      inc %asc
    }
  }
  ; return drive info
  elseif (($1 isnum) && ($gettok(%sub.drive.list,$1,124))) {
    var %d = $gettok($v1,1,32),%ty = $gettok($v1,2,32), %t = $gettok($v1,3,32), %f = $gettok($v1,4,32)
    return Drive %d $chr(149) $iif((%ty != 1),$upper($v1) $qt($disk(%d).label),$qt($disk(%d).label) $chr(149) $&
      $bytes(%t,g) GB $+([,free $bytes(%f,g) GB = $round($calc(%f / %t *100),1),$chr(37),])) : run $disk($1).path
  }
  ; return totals
  elseif ($1 == end) {
    return --TOTAL-- $bytes(%sub.drive.total,g) GB $+([,free $bytes(%sub.drive.free,g) GB = $&
      $round($calc(%sub.drive.free / %sub.drive.total *100),1),$chr(37),]) : noop
  }
}

menu status {
  Drive Info
  .$submenu($sub.drives($1))
}

Atm it's looking up "C:" to "Z:".
To start with "A:", change this line's value to "97":
var %asc = 99

Last edited by Horstl; 07/09/07 01:56 PM.