Rad,

Your code produces an error on my system.

ERROR : invalid method/function call: missing ')'!
Line : 4

Line 4 is this one:
$memory=val($memory)+val($mem[$a])

http://www.kixtart.org/board/ultimatebb.php?ubb=get_topic;f=12;t=000117


break on
for each $dimm in WMIQuery("Capacity","Win32_PhysicalMemory")
$mem[$a]=val($dimm) / 1048576
$memory=val($memory)+val($mem[$a])
$a=val($a)+1
next
$dimm1=$mem[0] $dimm2=$mem[1] $dimm3=$mem[2]

FUNCTION WMIQuery($sWhat, $sFrom, Optional $sComputer, Optional $sWhere, Optional $x)
Dim $sQuery, $objEnum, $sValue, $sItem, $lUbound
Dim $aTMP[0]

$sQuery = "Select " + $sWhat + " From "+ $sFrom
If Not $sComputer $sComputer=@WKSTA EndIf
If $sWhere AND $x $sQuery = $sQuery + " Where " + $sWhere + " = '"+$x+"'" EndIf

$SystemSet = GetObject("winmgmts:{impersonationLevel=impersonate}!//"+$sComputer)
If @ERROR Exit VAL("&"+Right(DecToHex(@ERROR),4)) Return EndIf

$objEnum = $SystemSet.ExecQuery($sQuery)
If @ERROR Exit VAL("&"+Right(DecToHex(@ERROR),4)) Return EndIf

For Each $objInstance in $objEnum
If $objInstance
$=Execute("$$sValue = $$objInstance.$sWhat")
Select
Case VarType($sValue) & 8192
For Each $sItem in $sValue
$lUbound = Ubound($aTMP)
If $aTMP[$lUbound] >' '
$lUbound = $lUbound +1
Redim Preserve $aTMP[$lUbound]
EndIf
$aTMP[$lUbound] = Trim($sItem)
Next
Case 1
$lUbound = Ubound($aTMP)
If $aTMP[$lUbound] >' '
$lUbound = $lUbound +1
Redim Preserve $aTMP[$lUbound]
EndIf
$aTMP[$lUbound] = Trim($sValue)
EndSelect
EndIf
Next
$WMIQuery = $aTMP
Exit VAL("&"+Right(DecToHex(@ERROR),4))
ENDFUNCTION


[ 12. July 2003, 09:53: Message edited by: NTDOC ]