VB Scirpt to get Folder Size

VB Scirpt to get Folder Size.

VB Script to get Folder Property.


dim oFS, oFolder
set oFS = WScript.CreateObject("Scripting.FileSystemObject")
set oFolder = oFS.GetFolder("D:\Nirav's Diary")

ShowFolderDetails oFolder

sub ShowFolderDetails(oF)
dim F
    wscript.echo oF.Name & ":Size=" & oF.Size/1024.00/1024.00 &"MB"
    wscript.echo oF.Name & ":Files=" & oF.Files.Count
    wscript.echo oF.Name & ":Folders=" & oF.Subfolders.count
    wscript.echo oF.Name & ":Modified Date=" & oF.DateLastModified
    wscript.echo oF.Name & ":Modified Date=" & oF.DateCreated
    for each F in oF.Subfolders
        ShowFolderDetails(F)
    next
end sub

Regards,

Nirav Gajjar