- Dim Fso, lecteur, Dc, nom, Capacite, Disponible
-
- Set Fso = CreateObject("Scripting.FileSystemObject")
-
- For Each lecteur in Fso.Drives
-
- If lecteur.DriveType = 3 Then
- nom = lecteur.ShareName
- Else
- If lecteur.IsReady Then
-
- '************ Nom de volume ********************'
-
- nom = lecteur.VolumeName
-
- '***** Espace disponible et capacité *********'
-
- Capacite = round (lecteur.TotalSize / 1024 / 1024 /1024 , 2) & " Go"
-
- if capacite<"1" then
- capacite= round (lecteur.TotalSize / 1024 / 1024 , 2) & " Mo"
- end if
-
- Disponible = round (lecteur.AvailableSpace / 1024 / 1024 / 1024 , 2) & " Go"
-
- if Disponible<"1" then
- Disponible= round (lecteur.AvailableSpace / 1024 / 1024 , 2) & " Mo"
- end if
-
- MsgBox lecteur.DriveLetter & " - " & nom & vbCrLf & "Capacité: " & Capacite & vbCrLf & "Disponible: " & Disponible ,, "Propriété du lecteur"
-
- Else
-
- '******** Lecteur non-disponible *************'
-
- nom = "< Non prêt >"
- Capacite = ""
- Disponible = ""
-
- MsgBox lecteur.DriveLetter & " - " & nom ,,"Lecteur disquette ou CD-ROM vide "
-
- End If
- End If
-
- next
-
- msgbox "MaRvIn CoRpOrAtIoN",,"SiGnAtUrE"
Dim Fso, lecteur, Dc, nom, Capacite, Disponible
Set Fso = CreateObject("Scripting.FileSystemObject")
For Each lecteur in Fso.Drives
If lecteur.DriveType = 3 Then
nom = lecteur.ShareName
Else
If lecteur.IsReady Then
'************ Nom de volume ********************'
nom = lecteur.VolumeName
'***** Espace disponible et capacité *********'
Capacite = round (lecteur.TotalSize / 1024 / 1024 /1024 , 2) & " Go"
if capacite<"1" then
capacite= round (lecteur.TotalSize / 1024 / 1024 , 2) & " Mo"
end if
Disponible = round (lecteur.AvailableSpace / 1024 / 1024 / 1024 , 2) & " Go"
if Disponible<"1" then
Disponible= round (lecteur.AvailableSpace / 1024 / 1024 , 2) & " Mo"
end if
MsgBox lecteur.DriveLetter & " - " & nom & vbCrLf & "Capacité: " & Capacite & vbCrLf & "Disponible: " & Disponible ,, "Propriété du lecteur"
Else
'******** Lecteur non-disponible *************'
nom = "< Non prêt >"
Capacite = ""
Disponible = ""
MsgBox lecteur.DriveLetter & " - " & nom ,,"Lecteur disquette ou CD-ROM vide "
End If
End If
next
msgbox "MaRvIn CoRpOrAtIoN",,"SiGnAtUrE"