PDA

Click to See Complete Forum and Search --> : Getting the size of a folder


Dec 3rd, 2000, 01:24 PM
How do i get the total size of a folder, including everything contained in it?

RManzione
Dec 3rd, 2000, 01:45 PM
Call the following routine where filespec is the name
of your folder

Sub ShowFolderSize(filespec)
Dim fs, f, s
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder(filespec)
s = UCase(f.Name) & " uses " & f.size & " bytes."
MsgBox s, 0, "Folder Size Info"
End Sub


Regards

Dec 3rd, 2000, 02:39 PM
Did you even look at what forum your in?

parksie
Dec 3rd, 2000, 03:27 PM
Biggest laugh I've had all day!

HarryW
Dec 3rd, 2000, 03:58 PM
Parksie, if that wasn't so sad it would be funny :rolleyes:

parksie
Dec 3rd, 2000, 04:03 PM
Hmmm...but I have been doing my stats 2 project all day, so :(

All I could find was opendir() and readdir(), but VC++ doesn't seem to have headers for them :(

Dec 3rd, 2000, 04:21 PM
Parksie, im using Turbo C++, and those are in dirent.h, how would i use them? Oh, and just because it might help, i have a function already set up to return the size in bytes of a file.

parksie
Dec 3rd, 2000, 04:23 PM
No idea. I have no documentation and no way of testing. So here's something from microsoft (of all people!):
http://msdn.microsoft.com/library/officedev/fpage/a_modfp.htm