Change the RED part to a valid computer name on your network!

;=====================================================
; Define the name of your test computer
; (later, enumerate a list of computers in a loop)
$Computer = ' COMPUTER'
;=====================================================


Once it works, and you configure the results the way you like, you can put the code below the $Computer= line, and up to the beginning of the UDF definition into a loop to process multiple computers. Obviously, delete or comment out the $Computer= part when you get to this point.

Try something like this to read a list of computer names from NAMES.TXT:
 Code:
If Open(3, "NAMES.TXT") = 1
  $Computer = ReadLine(3)
  While Not @ERROR

    ; reporting code goes here...

    $Computer = ReadLine(3)
  Loop
  $ = Close(3)
EndIf

Again, this is example code, not polished, prim, and proper. This example writes the data to the screen, but you can simply add a RedirectOutput('DiskReport.txt') to the beginning of the script. Don't forget to close the redirect with RedirectOutput(''), and capture the return values with $RC = in front of each RedirectOutput call. You'll probably want to delete or rename the output file first, since it will simply append the output to any existing file.

You need MBytes - the disk values are in bytes, and are STRINGS!! You need to divide by 1024 to get KBytes, or 1048576.0 to get MBytes. You're dealing with large values - above 32768, so should convert to doubles first - like this:
Right(' ' + CDbl($D_Capacities[$Index]) / 1048576.0, 15)

This converts the value to a double, divides it by 1 meg (as a double), converts the whole mess back to a string by prepending it with spaces, then trims the rightmost 15 characters. Phew! Might be easier to do this one step at a time till you get the hang of it.


Glenn

PS

Post your code if you get in a jam - I'd rather keep nudging you in the right direction till you understand it than hand you finished code. It's the teacher in me...

_________________________
Actually I am a Rocket Scientist! \:D