LATEST UPDATES
ShareHolder Finder v0.9.3 is now released!!! Check Product Page for more details.
✉ info@automationdevelopers.com

ITS ALL ABOUT AUTOMATION

AutoIt - Get Folder Size

Related Tutorials

DirGetSize


Returns the size in bytes of a given directory.

DirGetSize ( "path" [, flag = 0] )

Parameters

path The directory path to get the size from, e.g. "C:\Windows".
flag [optional] this flag determines the behaviour and result of the function, and can be a combination of the following:
    $DIR_DEFAULT (0) = (default)
    $DIR_EXTENDED (1) = Extended mode is On -> returns an array that contains extended information (see Remarks).
    $DIR_NORECURSE (2) = Don't get the size of files in subdirectories (recursive mode is Off)

Constants are defined in "AutoItConstants.au3".

Return Value

Success: the sizes that are greater than or equal to zero
Failure: -1 and sets the @error flag to non-zero if the path doesn't exist.

Remarks

If the script is paused then this function is paused too and will only continue when the script continues!

If you use the extended mode then the array returned from this function is a single dimension array containing the following elements:
$aArray[0] = Size
$aArray[1] = Files count
$aArray[2] = Dirs Count

Related Tutorials



Post a Comment