|
Sub DiveOnfo()
Dim objFSO As New Scripting.FileSystemObject
Dim drvLoop As Scripting.Drive
For Each drvLoop In objFSO.Drives
Debug.Print drvLoop.DriveLetter & ":\"
If drvLoop.DriveType = Fixed Or drvLoop.IsReady Then
Debug.Print " Total size: " _
& Format$(drvLoop.TotalSize / (1024 ^ 2), "#0.00 Mb")
Debug.Print " Free space: " _
& Format$(drvLoop.FreeSpace / (1024 ^ 2), "#0.00 Mb")
Debug.Print " Volume Label: " & drvLoop.VolumeName & vbCrLf _
& " SN: " & drvLoop.SerialNumber
Else
Debug.Print " Disk information unavailable"
End If
Next drvLoop
Set objFSO = Nothing
End Sub
这个是否可行 |
|