@Echo Off :: Space.BTM - Displays free space on disks :: Michael Bednarek, January 2000 :: V1.1 Oct-2004: Made to work under 4NT-U :: mb@mbednarek.com SetLocal UnAlias * :: Anyone more than 9 disks? Set disks=%@Upper[%1 %2 %3 %4 %5 %6 %7 %8 %9] :: No command line parameters, build a list of drives: Iff "%disks" == "" Then Set disks=C: %+ :: Everybody has a C: drive :: Get all disks, starting at C: until first gap :: (this will not cover network drives mapped after a gap) :: Look from "D" to "Z": Do td = 68 To 90 If %@Ready[%@Char[%td]:] == 0 Leave Set disks=%disks %@Char[%td]: EndDo EndIff For %disk In (%disks) Do GoSub DrawIt :: Compensate for the preparation for one drive too many: Screen %@Eval[%_Row-2] 0 Quit :DrawIt On Error (Echo %disk is not a Disk Drive%+Echo.%+Return) Set total=%@Disktotal[%disk] Set used=%@Diskused[%disk] On Error Set right=%@Eval[%_Columns-2] %+ :: zero based Set width=%@Eval[%right-2] Set percent=%@Eval[%used/%total] Set lbar=%@Int[%@Eval[%percent*%width+.5]] Echo Drive %disk (%@Label[%disk]) Capacity: %@Comma[%total] Used: %@Comma[%used] (%@Int[%@Eval[%percent*100+.5]]%=%) If %@Eval[%_Rows-%_Row] LT 5 (Echo.%+Echo.%+Echo.%+Echo.%+Echo.%+Screen -5 0) Set cur_row=%_Row DrawBox %@Eval[%cur_row+1] 1 %@Eval[%cur_row+3] %right 2 %_FG On %_BG :: Draw labels and ticks Set scale=%@Eval[%width/10] Do i = 1 To 9 Screen %cur_row %@Int[%@Eval[%scale*%i+0.5]] %[i]0 Screen %@Eval[%cur_row+1] %@Int[%@Eval[%scale*%i+1.5]] %@CHAR[9574] EndDo SCRPUT %@Eval[%cur_row+2] 2 BRIGHT YELLOW ON BLUE %@Repeat[%@CHAR[9619],%lbar] :: Prepare for the next drive Screen %@Eval[%cur_row+5] 0 Return