Returns the size in bytes of a given directory.
DirGetSize ( "path" [, flag = 0] )
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
#include <AutoItConstants.au3>
#include <MsgBoxConstants.au3>
Example()
Func Example()
Local $iSize= DirGetSize (@HomeDrive )
MsgBox ($MB_SYSTEMMODAL,"","Size(MegaBytes): "&Round ($iSize/ 1024/ 1024))
$iSize= DirGetSize (@WindowsDir ,$DIR_NORECURSE)
MsgBox ($MB_SYSTEMMODAL,"","Size(MegaBytes): "&Round ($iSize/ 1024/ 1024))
Local $hTimer= TimerInit ()
Local $aSize= DirGetSize ("\10円.0.0.1\h$",$DIR_EXTENDED); extended mode
If Not @error Then
Local $iDiff= Round (TimerDiff ($hTimer)/ 1000); time in seconds
MsgBox ($MB_SYSTEMMODAL,"","Size(Bytes): "&$aSize[0]&@CRLF _
&"Files: "&$aSize[1]&@CRLF &"Dirs: "&$aSize[2]&@CRLF _
&"TimeDiff(Sec): "&$iDiff)
EndIf
EndFunc ;==>Example