TotalSize (Propiedad)

Visual Basic VBLR

TotalSize (Propiedad)

           

Descripción

Devuelve el espacio total, en bytes, de una unidad o recurso compartido de red.

Sintaxis

objeto.TotalSize

El objeto es siempre un objeto Drive.

Comentarios

El código siguiente demuestra la utilización de la propiedad TotalSize:

Sub ShowSpaceInfo(drvpath)
    Dim fs, d, s
    Set fs = CreateObject("Scripting.FileSystemObject")
    Set d = fs.GetDrive(fs.GetDriveName(fs.GetAbsolutePathName(drvpath)))
    s = "Unidad " & d.DriveLetter & ":"
    s = s & vbCrLf
    s = s & "Tamaño total: " & FormatNumber(d.TotalSize/1024, 0) & " Kbytes"
    s = s & vbCrLf
    s = s & "Disponible: " & FormatNumber(d.AvailableSpace/1024, 0) & " Kbytes"
    MsgBox s
End Sub