Gets the drive memory, same as below. Just correcting errors
Gets the drive memory, same as below. Just correcting errors
Rate Gets the drive memory, same as below. Just correcting errors
(1(1 Vote))
Dim free, tob, tofb As Currency ' Sorry forget to add this to the other script
Private Sub Timer1_Timer()
Dim freec, tob, tofb As Currency
a = GetDiskFreeSpaceEx("C:\", freec, tob, tofb)
' Get the capacity of C drive
totm = (tob * 10000) ' Times by 10000
If totm / 1024 < 1 Then ' Getting the units
unit = "Bytes"
End If
If totm / 1024 / 1024 < 1 Then
totm = totm / 1024
unit = "KB"
End If
If totm / 1024 / 1024 / 1024 < 1 Then
totm = totm / 1024 / 1024
unit = "MB"
Else
totm = totm / 1024 / 1024 / 1024
unit = "Gb"
End If
totm2 = InStr(totm, ".") ' Getting the decimal place to shorten the value
totm3 = Mid(totm, 1, totm2 + 2)
' Get the freespace of the C drive
tofbm = tofb * 10000 ' Times by 10000
If tofbm / 1024 < 1 Then ' Getting the units
unit2 = "Bytes"
End If
If tofbm / 1024 / 1024 < 1 Then
tofbm = tofbm / 1024
unit2 = "KB"
End If
If tofbm / 1024 / 1024 / 1024 < 1 Then
tofbm = tofbm / 1024 / 1024
unit2 = "MB"
Else
tofbm = tofbm / 1024 / 1024 / 1024
unit2 = "Gb"
End If
tofbm2 = InStr(tofbm, ".") ' Getting the decimal place to shorten the value
tofbm3 = Mid(tofbm, 1, tofbm2 + 2)
Label1.Caption = "Used Space: " & totm3 - tofbm3 & "" & vbCrLf & "Free Space: " & tofbm3 & "" & vbCrLf & "Drive Capacity: " & totm3
End Sub
Gets the drive memory, same as below. Just correcting errors Comments
No comments yet — be the first to post one!
Post a Comment