获得剩余空间还好办
http://topic.csdn.net/t/20030212/12/1420351.html
http://topic.csdn.net/t/20010508/08/114477.html
获得总空间就不知道了!
Private Sub Command1_Click()
Dim fs As Object, d, s
Set fs = CreateObject("Scripting.FileSystemObject")
drvPath = "C:\" '自己修改此处
Set d = fs.GetDrive(fs.GetDriveName(drvPath))
s = "Drive " & UCase(drvPath) & " (Name: "
s = s & d.VolumeName & ")" & vbCrLf
s = s & "容量:" & FormatNumber(d.TotalSize, 0) & "Bytes" & vbCrLf
s = s & "可用空间:" & FormatNumber(d.freeSpace, 0) & "Bytes" & vbCrLf
s = s & "已用空间:" & FormatNumber(d.TotalSize - d.freeSpace, 0) & "Bytes"
MsgBox s
End Sub