I am trying to find a way to determine the total and available disk space in an arbitrary folder from a .NET app. By \"total disk space\" and \"available disk space\" in a f
Here's one more possibility that I've used for years. The example below is VBScript, but it should work with any COM-aware language. Note that GetDrive()
works on UNC shares as well.
Dim Tripped
Dim Level
Tripped = False
Level = 0
Sub Read(Entry, Source, SearchText, Minimum, Maximum)
Dim fso
Dim disk
Set fso = CreateObject("Scripting.FileSystemObject")
Set disk = fso.GetDrive(Source)
Level = (disk.AvailableSpace / (1024 * 1024 * 1024))
If (CDbl(Level) < CDbl(Minimum)) or (CDbl(Level) > CDbl(Maximum)) Then
Tripped = True
Else
Tripped = False
End If
End Sub