Here is the original thread where "most" of this code came from for those interested in a little more information on the topic.

TotalMem( $Systemname ) - Determine amount of memory installed using WMI

And here is the Software inventory routine that Fabian did back in Dec 2000 (his code needs some rework as well, but it went along the same lines of sorting the output. The ScriptLogic method does appear to work well though.

Inventory Script (Software/Network/User Info)

MCA's links to similar topics
Inventory tool

Radimus has a good long script for inventory as well.

Inventory Script for all OS's!