Hi - am trying to determine the folder size on the local machine. But for some reason it does not calculate the ProgramData folder. The script is
Total = 0
StrComputer = "."
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objParentFolder = objFSO.GetFolder("C:\")
For Each objSubfolder in objParentFolder.Subfolders
'wscript.echo objSubFolder.Name
GetFolderSize objSubfolder
Next
Sub GetFolderSize(Folder)
Dim lInt, aDecimalPlaces, strSize
If Folder.Name <> "Program Files" and Folder.Name <> "Documents and Settings" and Folder.Name <> "Program Files (x86)" and Folder.Name <> "Windows" Then
wscript.echo Folder.Name & " Size is - " & Folder.Size
Total = Total + FormatNumber((CDbl(Folder.Size)/1024/1024))
End If
End Sub