I must be doing something very wrong [Mad] cause it just hangs and never writes a file (though it does output to screen). I have to hit ctrl-z to get the prompt back.

Here is the whole script as I have it now:
code:
; * Test code
$PC = @wksta
if open(9, "s:\computing\scripts\" + @wksta + "_dr.txt",5) = 0
For Each $Disk In DiskInfo($PC)
$Disk ?
$RC = writeline(9, $Disk + @CRLF)
$RC = close (9)
Next
else
? "File open error = " @error
endif

Get $x

Return

; * End Test code

Function DiskInfo($PC)
Dim $Disks[0],$NumDisks,$Found,$Row
$DiskInfo = 0
$NumDisks = 0
$Found = 0
$Row = ''
$objWMI = GetObject("winmgmts:{impersonationlevel=impersonate}!//" + $PC)
If @Error
Return
EndIf
$colDisks = $objWMI.ExecQuery("Select * From win32_logicalDisk")
For Each $objDisk In $colDisks
If $objdisk.mediatype = 12
Dim $Row[4]
$Row = $objdisk.name + chr(9);','
$Row = $Row + $objdisk.FileSystem + chr(9) ;','
$Row = $Row + $objDisk.size + chr(9) ;','
$Row = $Row + $objDisk.FreeSpace
ReDim Preserve $Disks[$NumDisks]
$Disks[$NumDisks] = $Row
$NumDisks = $NumDisks + 1
$Row = ''
$Found = 1
EndIf
Next
$objWMI = 0
If $Found
$DiskInfo = $Disks
EndIf
EndFunction

Any reason why it would be hanging? Geez, I feel like an idiot.

In my 8th grade science class I was the only kid whose fake volcanoe didn't work. Go figure...

[ 20. September 2002, 22:21: Message edited by: Shane ]