The first line depends on how you plan on running the script. I assume if you use SMS you will be launching the script to run on each specific machine locally, not running it from a server that connects to the machine remotely. When running the script locally the "." implies the current system, much like it can be used for the current directory in a cmd shell. If you where using list, either from a text file or a query of Active Directory the "." would be replaced with the variable name that represented the current computer in the array.
What I would do to write the data is make sure a share available for all users and that they can write to it. At the top of the script we will create a few new objects and set a couple of variables.
------------------------------------------------------------------------------------------
ForWriting = 2
Set oNetwork = WScript.CreateObject("WScript.Network")
Set oFSO = WScript.CreateObject("Scripting.FileSystemObject")
sResultsFilePath = "\\server\share\" & oNetwork.Computername & "-meminv.txt"
Set oResultsFile = oFSO.OpenTextFile(sResultsFilePath, ForWriting, True)
------------------------------------------------------------------------------------------
So now we jump down to were we need to write data.
Win32_PhysicalMemory Section:
------------------------------------------------------------------------------------------
oResultsFile.WriteLine "Memory Location: " & sMemLoc & vbCrLf & _
"Memory Capacity: " & sMemCap & " MB" & vbCrLf & _
"Memory Speed : " & sMemSpd & vbCrLf
Win32_PhysicalMemoryArray Section:
------------------------------------------------------------------------------------------
oResultsFile.Writeline "Maximum Memory Capacity: " & sMaxMemCap & " MB" & vbCrLf & _
"Maximum Number of DIMMS: " & sMaxMemDev & vbCrLf
Then finally at the end:
------------------------------------------------------------------------------------------
oResultsFile.Close
Here is What the results look like:
------------------------------------------------------------------------------------------
Memory Location: DIMM_1
Memory Capacity: 1024 MB
Memory Speed : 533
Memory Location: DIMM_3
Memory Capacity: 512 MB
Memory Speed : 533
Memory Location: DIMM_2
Memory Capacity: 1024 MB
Memory Speed : 533
Maximum Memory Capacity: 4096 MB
Maximum Number of DIMMS: 4