The new Microsoft Scripting Runtime library includes a FileSystemObject hierarchy containing several objects that let you obtain information about your drives, folders, and files. For example, you can retrieve the serial number of a disk using this code:
' Get the serial number of drive C:Dim fso As New Scripting.FileSystemObjectDim dr As Scripting.Drive' Get a reference to the Drive objectSet dr = fso.GetDrive("C")Print Hex$(dr.SerialNumber)
You can also easily check whether a drive has enough free space on it, using the Drive object’s FreeSpace property:
Print "Drive C: has " & dr.FreeSpace " bytes free."
For more information, look on VB’s Help file under “Dictionary” and “FileSystemObject.”