Question

Locked

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
Next
end function
</script>

///////////////////////////////////////////////

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.

Andrew

This conversation is currently closed to new comments.

0 total posts (Page 1 of 1)  
Thread display: Collapse - | Expand +

All Answers

Share your knowledge
Back to Hardware Forum
0 total posts (Page 1 of 1)  

Related Discussions

Related Forums