DriveSpaceFree

Retrieves the free disk space of the drive which contains the specified path, in megabytes.

DriveSpaceFree, OutputVar, Path

Parameters

OutputVar

The variable in which to store the result, which is rounded down to the nearest whole number.

Path

Any path contained by the drive (might also work on UNC paths and mapped drives).

Remarks

OutputVar is set to the amount of free disk space in Megabytes (rounded down to the nearest Megabyte).

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.

Drive, DriveGet

Examples

Retrieves the free disk space of the C drive and stores it in FreeSpace.

DriveSpaceFree, FreeSpace, C:\

Retrieves and reports the free disk space of the drive which contains A_MyDocuments.

DriveSpaceFree, FreeSpace, % A_MyDocuments
MsgBox % FreeSpace " MB"