Results 1 to 2 of 2

Thread: Files Size [SOLVED]

  1. #1

    Thread Starter
    Hyperactive Member boku's Avatar
    Join Date
    Dec 2004
    Posts
    386

    Resolved Files Size [SOLVED]

    Is it possible in vb 6 to check a dir...and count the total size for all the files in it?
    Last edited by boku; Mar 16th, 2005 at 05:00 AM.
    -BoKu-

  2. #2
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: Files Size

    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:
    1. Private Sub Command1_Click()
    2. Dim fso As Object
    3. Dim fdr As Object
    4.  
    5.     Set fso = CreateObject("Scripting.FileSystemObject")
    6.     Set fdr = fso.GetFolder("c:\temp\")
    7.     MsgBox fdr.Path & " size: " & fdr.Size & " bytes"
    8.  
    9. End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width