SoFunction
Updated on 2025-04-09

VBS Tutorial: Object-Drive Object

Drive Objects

Provides access to properties of disk drives or network shares.

illustrate

The following code shows how to use itDriveObject access drive properties:

Function ShowFreeSpace(drvPath)Dim fso, d, s    Set fso = CreateObject("")    Set d = ((drvPath))    s = "Drive " & UCase(drvPath) & " - "     s = s &   & "<BR>"    s = s & "Available space: " & FormatNumber(/1024, 0) s = s & "KB"ShowFreeSpace = sEnd Function