|
|
|
| 9 January 2002 | GetFolderSize() |
| Author | ScriptLogic Corporation |
| Action | Return the total bytes consumed by the files in a folder tree. |
| Syntax | GetFolderSize ("path") |
| Parameters | |
| Remarks | Great example of using COM within a UDF. |
| Returns | Returns a number representing the total number of bytes consumed by the files located within the folder and its subfolders. |
| Dependencies | None. |
| Examples |
$result = GetFolderSize("c:\temp")
|
| Source |
FUNCTION GetFolderSize ($path)
DIM $fso, $fold
$getfoldersize = -3
IF Exist($path) = 1
$fso = CreateObject("scripting.filesystemobject")
$fold = $fso.getfolder($path)
$getfoldersize = $fold.size
EXIT(0)
ELSE
EXIT(3)
ENDIF
ENDFUNCTION ; - GetFolderSize -
|
|
|
|