Function Reference


DriveSpaceFree

Returns the free disk space of a path in Megabytes.

DriveSpaceFree ( "path" )

Parameters

path Path of drive to receive information from.

Return Value

Success: the free disk space in Megabytes as a float number.
Failure: 0 and sets the @error flag to 1.

Remarks

DriveSpaceFree() may even work when a complete directory path (that exists) is given. However, a file path won't work.
Use the Round() function if the return value is too precise.

Related

DriveGetDrive, DriveGetFileSystem, DriveGetLabel, DriveGetSerial, DriveGetType, DriveSetLabel, DriveSpaceTotal, DriveStatus

Example

#include <MsgBoxConstants.au3>

Local $iFreeSpace = DriveSpaceFree(@HomeDrive & "\") ; Find the free disk space of the home drive, generally this is the C:\ drive.
MsgBox($MB_SYSTEMMODAL, "", "Free Space: " & $iFreeSpace & " MB")