Showing posts with label RAM Size of the computer using QTP and VbScript. Show all posts
Showing posts with label RAM Size of the computer using QTP and VbScript. Show all posts

20 May 2013

How to get the RAM Size of the computer using QTP/VbScript?


How to get the RAM Size of the computer using QTP/VbScript?

strComputer = "."
  
Set objWMIService = GetObject("winmgmts:"& "{impersonationLevel=impersonate}!\\"& 

strComputer & "\root\cimv2")

Set colPC = objWMIService.ExecQuery("Select * from Win32_ComputerSystem")

For Each objPC in colPC

msgbox Round(objPC.TotalPhysicalMemory/(1024*1024*1024),3)

Next