Im in need of some code that can burn a folder to a cd. is there a way to check what size a folder is beforehand?
Hi there,
Yes, there is a way to get folder size using VB & FSO, firstly add reference to Scripting Runtime Engine, use the below code segment, hope it helps. Good luck & take care.
-
Dim objFSO As Object
-
Dim objFolder as Object
-
Dim i As Long
-
-
Set objFSO = CreateObject("Scripting.FileSystemObject")
-
Set objFolder = objFSO.GetFolder("C:\Program Files")
-
i = objFolder.Size
-
-
Set objFolder = Nothing
-
Set objFSO = Nothing
-
This will return the size of the folder in bytes.