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

Monitoring Disk Space

Status
Not open for further replies.

sibleytr

Technical User
Jan 27, 2005
21
US
Currently I have a flat MDB that I track my network storage items in. It's a simple MDB used to create tbl's, frm's and rpt's. The Tbl's contain my Server and Max storage information and then I take a manual reading and data input of each server and it's remaining space reading. What I'm wanting to do, for lack of a better word, is query my a server and retrieve the free space information.

freeSpace = Srv1MaxSpace - Srv1ExistingSpace

Would FSO (file system object) be the component I need to do this or does anyone have any other ideas or sample code on how I can get started?

Any help would be appreciated.

 
A starting point:
Code:
Function ShowFreeSpace(Optional drvPath = "C:")
   Dim fso, d, s
   Set fso = CreateObject("Scripting.FileSystemObject")
   Set d = fso.GetDrive(fso.GetDriveName(drvPath))
   s = "Drive " & UCase(drvPath) & " - "
   s = s & d.VolumeName & vbCrLf
   s = s & "Total Size: " & FormatNumber(d.TotalSize / 1024, 0) & " Kbytes" & vbCrLf
   s = s & "Free Space: " & FormatNumber(d.FreeSpace / 1024, 0) & " Kbytes"
   ShowFreeSpace = s
End Function

MsgBox FreeSpace("\\myServer\SharedFolder")

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top