Get PC Physical Memory Size via VB Script

By andrew.zou ·
Hi guys,
I had been trying to get the PC physical memory size via bwelow code:

<script LANGUAGE="VBScript" type="text/vbscript">
function getTotalMemory()
strComputer = "."
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colSettings = objWMIService.ExecQuery("Select * from Win32_ComputerSystem")
For Each objComputer in colSettings
getTotalMemory = objComputer.TotalPhysicalMemory
end function


But the browser says Active component object can't create object: 'GetObject'

While I run it via *.vbs thru the DOS shell, it gave me the right result.

Any body can help me to make this piece of code work via browser (HTML page).

Thanks in advance.


This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Share your knowledge

Related Discussions

Related Forums