Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Physical Memory

Status
Not open for further replies.

JanyMoon

Programmer
Oct 17, 2005
12
SI
How to find out amount of physical memory with VPF?
 
This requires WMI to be installed

Code:
On Error *
lcComputer = "."
loWMIService = GetObject("winmgmts:\\" + lcComputer + "\root\cimv2")
colItems = loWMIService.ExecQuery("Select * from Win32_PhysicalMemory",,48)
For Each loItem in colItems
?"Bank Label: " + loItem.BankLabel
?"Capacity: " + loItem.Capacity
?"Data Width: " + loItem.DataWidth
?"Description: " + loItem.Description
?"Device Locator: " + loItem.DeviceLocator
?"Form Factor: " + loItem.FormFactor
?"Hot Swappable: " + loItem.HotSwappable
?"Manufacturer: " + loItem.Manufacturer
?"Memory Type: " + loItem.MemoryType
?"Name: " + loItem.Name
?"Part Number: " + loItem.PartNumber
?"Position In Row: " + loItem.PositionInRow
?"Speed: " + loItem.Speed
?"Tag: " + loItem.Tag
?"Type Detail: " + loItem.TypeDetail
Next



Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
ReFox XI (www.mcrgsoftware.com)
 
Is there no function like sys(nSomething) or API ?
 

JanyMoo,

Try the GlobalMemoryStatus() API call:

Code:
DECLARE GlobalMemoryStatus IN win32API STRING @cMemBuffer
cMemBuffer=REPLICATE(CHR(0),32)
GlobalMemoryStatus(@cMemBuffer)

Bytes 5 to 8 of cMemBuffer will contain the required value. The value is in binary, so will need to be converted to a form in which you can display it.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top