Please tell me how to find a directory size 
Author Message
 Please tell me how to find a directory size

Dear All

        Please help me to find the size of a directory including all its
        subdirectories....

         Thank you
                      Terence



Thu, 31 Jul 2003 16:56:49 GMT  
 Please tell me how to find a directory size
One method would be to use the FileSystemObject.
Add a Project Reference for "Microsoft Scripting Runtime"
This example returns the total size of a Windows folder and all it's
sub-folders.

Option Explicit
Dim Fsys As New FileSystemObject

Private Sub Command1_Click()
Dim thisFolder As Folder
Dim strx As String

    Set thisFolder = Fsys.GetFolder("c:\Windows\")
    strx = Format(thisFolder.Size / 1048576, "#.##")

    MsgBox "The total size of the WINDOWS folder is " & _
      strx & " MB."

End Sub

Quote:

> Dear All

>         Please help me to find the size of a directory including all its
>         subdirectories....

>          Thank you
>                       Terence



Sat, 02 Aug 2003 04:12:39 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Find file and directory size...

2. Finding the size of a Directory

3. Finding the size of a directory

4. Need to find the size of a directory (not the contents)

5. Size file or size directory

6. Finding changes in directory and sub-directories

7. New find directory control I found...

8. How to tell which directory the access database is running in

9. How to tell if directory is empty or not

10. How to tell if a directory exists?

11. How to tell if a specific directory exists

12. API to tell which DIRECTORY in Windows EXPLORER the user right clicked on

 

 
Powered by phpBB® Forum Software