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.
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.
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
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.