FreeDiskSpace Property

Applies To

System object.

Description

Returns the available disk space for the current drive, in bytes. Use the ChDir statement to change the current drive. Read-only Long.

Note There are 1,024 bytes in a kilobyte and 1,048,576 bytes in a megabyte.

Example

This example checks the amount of free disk space. If there's less than 10 megabytes of space available, a message is displayed.

If (System.FreeDiskSpace \ 1048576) < 10 Then MsgBox "Low disk space"