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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

View clients current available RAM 3

Status
Not open for further replies.

wusinik

Programmer
Jul 12, 2001
20
US
I am looking to check the amount of RAM available on client machines before a command can be executed...I think I need to utilize sysinfo but I am not sure exactly what functions to call.

Thanks
 
i just got this

Private Type MEMORYSTATUS
dwLength As Long
dwMemoryLoad As Long
dwTotalPhys As Long
dwAvailPhys As Long
dwTotalPageFile As Long
dwAvailPageFile As Long
dwTotalVirtual As Long
dwAvailVirtual As Long
End Type
Private Declare Sub GlobalMemoryStatus Lib "kernel32" (lpBuffer As MEMORYSTATUS)

Private Sub Timer1_Timer()
Dim MemStat As MEMORYSTATUS
'retrieve the memory status
GlobalMemoryStatus MemStat
MsgBox "You have" + Str$(MemStat.dwTotalPhys / 1024) + " Kb total memory".
End Sub--------------------------------------------------------------------------------
Set the Timer to fire at an interval consistent with your application requirements.



 
This code will be very helpful...however I need to read the amount of AVAILABLE/FREE memory, not total (used + unused) RAM.
 
Also, I only need to check the C:\ Drive on clients' machines because that is the only drive where my program writes to.
Thanks so much for your assistance!
 
If you are looking to find how much disk space is available on a particular drive, the finding the amount of Available/free memory won't be much good will it !!!

Memory and disk space are two completely different things

To find out how much memory is available, see the above.

To find out how much disk space is available:
Put a reference in VB to 'Microsoft Scripting Runtime'

Dim objFileSys as filesystemObject

Set objFileSys = new Filesystemobject

' Drives is a collection of all drives
' on the current machine, so you need to
' access the appropriate one
objFileSys.Drives(0).FreeSpace

Hope this helps,

Chris Dukes
 
Both of these code bits were very helpful...thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top