Break On
; print the header
'Drv Label Capacity Free <!>' ?
;=====================================================
; Define the name of your test computer
; (later, enumerate a list of computers in a loop)
; $Computer = 'COMPUTER'
If Open(3, "C:\servers.TXT") = 0
$Computer = ReadLine(3)
While Not @ERROR
; reporting code goes here... YES - THE CODE THAT DOES THE WORK!!
; load the array from the computer
$aSysInfo = WMISysInfo($Computer)
@SERROR ?
UBound($aSysInfo) ?
If UBound($aSysInfo) = -1
'Bad computer name or no access! (' $Computer ')' ?
Else
$Computer ?
; Examine the disk drives & capacities
$D_Letters = Split($aSysInfo[32], ',')
$D_VolumeName = Split($aSysInfo[30], ',')
$D_Capacities = Split($aSysInfo[33], ',')
$D_FreeSpace = Split($aSysInfo[34], ',')
For $Index = 0 to UBound($D_Letters)
Left($D_Letters[$Index] + ' ', 4) ; 15 spaces between quotes
Right(' ' + Int(CDbl($D_Capacities[$Index]) / 1048576.0), 15)
Right(' ' + Int(CDbl($D_FreeSpace[$Index]) / 1048576.0), 15)
If CDbl($D_FreeSpace[$Index]) < 500000
' <Low!>'
EndIf
?
Next
EndIf
$Computer = ReadLine(3)
Loop
$ = Close(3)
Else
@SERROR ?
EndIf