I have a script that is in place that detects, among other things, the amount of total physical memory. I have a mixed environment but the script works great except for detecting the memory on a handful of NT 4 machines. Here's the code that I have been using for NT 4:

code:
 Shell "%comspec% /c winmsd /s /f" 
Shell '%comspec% /c type '+@wksta.txt+' | find " Total:" >$memtmp'
If Open(1,$memtmp) = 0
$result = Trim(ReadLine(1))
$pos = InStr($result, "total:")
If ($pos <> 0)
$memory = SubStr($result,$pos+6,Len($result)-$pos-1)
$memory = Val(Replace($memory,",",""))
$memMB = $memory/1024
Else
$memMB = "Unknown"
EndIf
$cf= Close(1)
Del $memtmp
EndIf

Obviously, the variables shown above along with the replace function are defined at the begining of the script. This code has been ran against 900 workstations and has only failed on 12 workstations. The workstations are in another state so I can't sit down at one of them to troubleshoot. The reason that this code is failing is because on these machines (for some reason that I can't explain) when the WINMSD summary report is created there is no memory information at all in the report.

Has anyone seen this before, or does anyone have any other suggestions for determining the memory on a NT 4 machine without using a 3rd party utility?

BTW... MemorySize(0) fails as well.