Instructions for Creating your TotalPhysicalMemory WMI Script
1. Copy and paste the example script below into notepad or a VBScript editor.
2. Decide which machine to interrogate and then change line 10 accordingly:
my default for strComputer = "." means the current machine.
3. Save the file with a .vbs extension, for example: Memory.vbs
4.Double click Memory.vbs and check the TotalPhysicalMemory (RAM).
--------------------------------------------------------------------------------------------------------------
Option Explicit
Dim objWMIService, objComputer, colComputer
Dim strLogonUser, strComputer
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")
Set colComputer = objWMIService.ExecQuery _
("Select * from Win32_ComputerSystem")
For Each objComputer in colComputer
Wscript.Echo "System Name: " & objComputer.Name _
& vbCr & "Total RAM " & objComputer.TotalPhysicalMemory
Next
WScript.Quit

