Is it possible in vb 6 to check a dir...and count the total size for all the files in it?
Printable View
Is it possible in vb 6 to check a dir...and count the total size for all the files in it?
Since folder may contain subfolders it could be a real pain to do that.
However, the simplest way would be to use FSO (file system object). Here is a quick sample:
VB Code:
Private Sub Command1_Click() Dim fso As Object Dim fdr As Object Set fso = CreateObject("Scripting.FileSystemObject") Set fdr = fso.GetFolder("c:\temp\") MsgBox fdr.Path & " size: " & fdr.Size & " bytes" End Sub