Returns the free disk space of the drive which contains the specified path, in megabytes.
FreeSpace := DriveGetSpaceFree(Path)
Any path contained by the drive (might also work on UNC paths and mapped drives).
This function returns the free disk space of the drive which contains the specified path, in megabytes (rounded down to the nearest megabyte).
An exception is thrown on failure.
In general, Path can be any path. Since NTFS supports mounted volumes and directory junctions, different paths with the same drive letter can produce different amounts of free space.
DriveGetCapacity, Drive functions
Retrieves and reports the free disk space of the drive which contains A_MyDocuments.
FreeSpace := DriveGetSpaceFree(A_MyDocuments) MsgBox FreeSpace " MB"
See example #1 on the Drive Functions page for another demonstration of this function.