* // declare vars
LOCAL laDrivetype(6), lcFont, oFSO
laDrivetype(1) = [unknown]
laDrivetype(2) = [removable drive]
laDrivetype(3) = [local harddrive]
laDrivetype(4) = [network drive]
laDrivetype(5) = [CD/DVD-ROM drive]
laDrivetype(6) = [RAM disk]
lcFont = _screen.FontName
_screen.FontName = [Courier New]
oFSO = CREATEOBJECT([Scripting.FileSystemObject])
CLEAR
* // display column names (headline)
? PADR( [VO] , 3 , [ ] )
?? PADR( [Type] , 21 , [ ] )
?? PADR( [Filesystem] , 11 , [ ] )
?? PADL( [SerialNo] , 13 , [ ] )
?? [ ]
?? PADR( [Volumename] , 33 , [ ] )
?? PADR( [Total Size] , 20 , [ ] )
?? PADR( [Free ] , 20 , [ ] )
?? PADR( [Available ] , 20 , [ ] )
FOR EACH oDrive IN oFSO.Drives
WITH oDrive
? PADR( .DriveLetter + [:] , 3 , [ ] )
?? PADR( laDriveType( .DriveType + 1 ) , 21 , [ ] )
IF .Isready
?? PADR( .FileSystem , 11 , [ ] )
?? PADL( CheckSerialNo( .SerialNumber ) , 13 , [ ] )
?? [ ]
?? PADR( IIF( .DriveType = 3 , .ShareName, .VolumeName ) , 32 , [ ] )
?? TRANSFORM( .TotalSize / 1000 / 1000 , [999,999] ) + [ MB (]
?? PADL( .TotalSize / 1024 / 1024 / 1024 , 4 , [ ] ) + [ GB)]
?? TRANSFORM( .FreeSpace / 1000 / 1000 , [999,999] ) + [ MB (]
?? PADL( .FreeSpace / 1024 / 1024 / 1024 , 4 , [ ] ) + [ GB)]
?? TRANSFORM( .AvailableSpace / 1000 / 1000 , [999,999] ) + [ MB (]
?? PADL( .AvailableSpace / 1024 / 1024 / 1024 , 4 , [ ] ) + [ GB)]
ELSE
?? [not accessible]
ENDIF
ENDWITH
ENDFOR
_screen.FontName = lcFont
RELEASE laDrivetype, lcFont, oFSO
FUNCTION CheckSerialNo as Integer
LPARAMETERS vInt as Integer
RETURN IIF( vInt > 0 , vInt , INT( 2 ^ 32 + vInt ) )
ENDFUNC