I need to find what the overall total byte size is of all files within a folder but the number of files, file types and file names will be different each time.
Is there a way I can do this simply, something along the lines of:
FileSize>C:\Temp\*.*,nFileSize
Or do I need to count the number of files, capture all the file names in an array, extract each file name, get the filesize of each file and add the result together each time?
Get Total File Size of All Files In Folder
Moderators: Dorian (MJT support), JRL
Re: Get Total File Size of All Files In Folder
Code: Select all
VBSTART
Function GetFolderSize(Path)
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(Path)
GetFolderSize = objFolder.Size
End Function
VBEND
VBEval>GetFolderSize("c:\temp"),fSize
MDL>fSize