1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| '
' Rajouter la référence à
' Microsoft Scripting Runtime
'
Sub InfoEspaceDisques()
Dim fso As New FileSystemObject, d As Drive, txt As String
For Each d In fso.Drives
'If d.DriveType = 2 Or d.DriveType = 5 or d.DriveType = 3 Then
If d.DriveType = Fixed Or d.DriveType = RamDisk Or _
d.DriveType = Remote Then
txt = txt & "Disk " & d.DriveLetter & "(" & d.VolumeName & ")" & vbTab
txt = txt & "Total : " & d.TotalSize & vbTab
txt = txt & "Libre : " & d.FreeSpace & vbCrLf
Debug.Print txt
End If
Next
Set fso = Nothing
End Sub |
Partager