Set objFSO = CreateObject("Scripting.FileSystemObject")
Totalbytes = 0
' Using hard coded folder names
Set objFolder = objFSO.GetFolder("F:\Download\Alacarta\Programas")
Totalbytes = Totalbytes + objFolder.Size
Set objFolder = objFSO.GetFolder("F:\Download\App-install")
Totalbytes = Totalbytes + objFolder.Size
Set objFolder = objFSO.GetFolder("F:\Download\usenet")
Totalbytes = Totalbytes + objFolder.Size
wscript.echo "Crude Number Representation"
wscript.echo
wscript.echo "Total size = " & Totalbytes & " bytes"
wscript.echo "Total size = " & (Totalbytes/1024) & " KB"
wscript.echo "Total size = " & (Totalbytes/(1024*1024)) & " MB"
wscript.echo "Total size = " & (Totalbytes/(1024*1024*1024)) & " GB"
wscript.echo
' I suspect that you will not require to see the max number of decimal places
' so here's how to format the number
' change false to true and see what happens...
DecimalPlaces = 2
IncludeLeadingDigit = False
UseParensForNegativeNumbers = False
GroupDigits = False
wscript.echo "Formatted Number Representation"
wscript.echo
wscript.echo "Total size = " & Formatnumber((Totalbytes/1024), DecimalPlaces, IncludeLeadingDigit, UseParensForNegativeNumbers , GroupDigits) & " KB"
wscript.echo "Total size = " & Formatnumber((Totalbytes/(1024*1024)), DecimalPlaces, IncludeLeadingDigit, UseParensForNegativeNumbers , GroupDigits) & " MB"
wscript.echo "Total size = " & Formatnumber((Totalbytes/(1024*1024*1024)), DecimalPlaces, IncludeLeadingDigit, UseParensForNegativeNumbers , GroupDigits) & " GB"