1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim oFSO As Object
Dim oDrive As Object
Dim i As Integer
Dim text1 As String = "\\aixcentre\c$\"
Dim text2 As String = "\\biollay\c$\"
For i = 1 To 2
oFSO = CreateObject("Scripting.FileSystemObject")
oDrive = oFSO.GetDrive("text" & i)
If oDrive.freespace > 1 Then
If oDrive.IsReady Then
MsgBox("Free space: " & ConvertFreeSpace(oDrive.FreeSpace))
Else
MsgBox("Free space: <drive unavailable>")
End If
End If
Next
oDrive = Nothing
oFSO = Nothing |
Partager