Pages

Monday, 16 July 2012

Get RAM Size - VBSCript

Following script displays the RAM present on a system



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/(1024*1024)
Next 


WScript.Quit 



No comments:

Post a Comment