Results 1 to 3 of 3

Thread: How to get Folder's size?

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2000
    Location
    Thailand
    Posts
    1

    Post

    How to get Folder's size?
    Not disk free space or not file size it is just folder size like a right click of properties.

    Thanks

  2. #2
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923

    Post

    It's a bit of a slow way of doing it, but you could simply get the size of each file in the directory and add them up...

    Use a loop to gather size of each file in the directory (look up the Dir() function in Help and go to http://www.vb-world.net/files/fileinfo/ to find out about getting file size), then simply add each file size to a variable...

    Hope that helps

    regards,

    ------------------
    - Chris
    [email protected]
    If it ain't broke - don't fix it

  3. #3
    Member
    Join Date
    Jan 1999
    Location
    Longmont,CO
    Posts
    53

    Post

    Use the Folder object. Set a reference to Microsoft Scriptime Runtime and then instantie a folder object and a file system object.

    Dim fso As FileSystemObject
    Dim fldr As Folder

    Set fso = New FileSystemObject

    Set fldr = fso.GetFolder(path to folder)

    ?fldr.Size


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