Drive Space Information



Dim sms,DRVNM,FSO,tlin,blin
Set FSO = CreateObject("Scripting.FileSystemObject")
 tlin=chr(13) & "." & chr(13)
 blin= "========================================" & chr(13)



Function DRIVEINFO(DRVNM,FSO)
 Dim CDRV,line1,line2
 Dim ent,spc,bar,totalspc,usedspc,percent,availablespc


 Set CDRV = FSO.GetDrive(DRVNM)
 ent = chr(13)
 spc= " "
 totalspc=FormatNumber(CDRV.totalsize / 1024, 0)
 usedspc=FormatNumber(CDRV.totalsize / 1024 - CDRV.freespace / 1024, 0)
 availablespc=FormatNumber(CDRV.freespace / 1024, 0)
 percent=int(usedspc*100/totalspc)


 for c=0 to percent
  bar=bar & "I"
 next
 for c=0 to 100-percent
  bar=bar & " "
 next
 for c=0 to 62
  line1=line1 & "_"
  line2=line2 &  chr(175)
 next


 DRIVEINFO = CDRV.Driveletter & "  " & CDRV.Volumename & "  " &  percent & "%   (  Used " & usedspc & " MB " & "   Available " & availablespc & " MB )" & ent  & "| Used space | " & bar & "|" & chr(13) & ent 


End Function


sms=  "LOCAL DRIVE INFORMATION" & tlin & DRIVEINFO("c:\",FSO) & DRIVEINFO("d:\",FSO) & DRIVEINFO("e:\",FSO) & DRIVEINFO("F:\",FSO) & DRIVEINFO("G:\",FSO)
MsgBox sms ,,"Dr Drive "