• Advertisement

Script to Discover how much RAM there is on "NetworkMachine"

Visual Basic Scripting
Forum rules
Only Related To Vbscript

Script to Discover how much RAM there is on "NetworkMachine"

Postby admin » Fri Jan 06, 2012 11:56 pm

Instructions for Creating your TotalPhysicalMemory WMI Script

1. Copy and paste the example script below into notepad or a VBScript editor.
2. Decide which machine to interrogate and then change line 10 accordingly:
my default for strComputer = "." means the current machine.
3. Save the file with a .vbs extension, for example: Memory.vbs
4.Double click Memory.vbs and check the TotalPhysicalMemory (RAM).


--------------------------------------------------------------------------------------------------------------
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
Next

WScript.Quit
admin
Site Admin
 
Posts: 49
Joined: Sun Jun 27, 2010 12:02 am

Advertisement

Return to VBScript

Who is online

Users browsing this forum: No registered users and 0 guests

cron