MSDN 에서는
http://support.microsoft.com/kb/202455/ko
요렇게 되어 있으니 참고해서, 간단히 요렇게 만들고...
Private Declare Function GetDiskFreeSpaceEx Lib "kernel32" Alias "GetDiskFreeSpaceExA" (ByVal lpRootPathName As String, lpFreeBytesAvailableToCaller As Currency, lpTotalNumberOfBytes As Currency, lpTotalNumberOfFreeBytes As Currency) As Long
Private Sub Command1_Click()
Call DiskSpace
End Sub
'// 여유 용량 체크
Private Sub DiskSpace()
Dim strDrive As String
Dim lFreeBytesToCallers As Currency
Dim lTotalBytes As Currency
Dim lFreeBytes As Currency
Dim lRetVal As Long
Dim IFree As Double
strDrive = "C:\"
lRetVal = GetDiskFreeSpaceEx(strDrive, lFreeBytesToCallers, lTotalBytes, lFreeBytes)
IFree = Format((CDbl(lFreeBytes * 10000) / 1024 / 1024 / 1024), "#.00")
If IFree < 10 Then
lblDisk.Caption = IFree & " GB "
LblTime.Caption = "디스크 용량이 부족합니다."
Else
lblDisk.Caption = IFree & " GB"
End If
End Sub
여기서 IFree = Format((CDbl(lFreeBytes * 10000) / 1024 / 1024 / 1024), "#.00") 는 결과값이 byte 로 나오기 때문에 GB 단위로 변환하면서 소숫점 두자리 까지만 보여줄려고 하는것.
이렇게 하고 실행하면...
OK.
끝자리가 조금 다르긴하지만(아마도 반올림 때문인듯)... 뭐, 저정도는 넘어가자.

