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
Printable View
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
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 :)
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