Get Free Disk Space

Category:
System/API
Type:
Snippets
Difficulty:
Advanced
Author:
Intelligent Solutions Inc.

Version Compatibility:

More information:
These return the amount of free space on a disk in bytes, kilobytes, and megabytes.

According to Microsoft's documentation, on Windows 95 systems, the API function used here (GetDiskFreeSpace) returns incorrect values for volumes that are larger than 2 gigabytes. The GetDiskFreeSpaceEx function corrects this problem. However, the latter function is not avaible on pre-OSR2 Windows 95 systems; that's why it's not used here.

Instructions: Copy the declarations and code below and paste directly into your VB project.

Declarations:

Code: