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.
If you're asking for technical help, please be sure to include all your system info, including operating system, model number, and any other specifics related to the problem. Also please exercise your best judgment when posting in the forums--revealing personal information such as your e-mail address, telephone number, and address is not recommended.
Get PC Physical Memory Size via VB Script
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