|
|
|
You can retrieve information about all the available drives using calls to Windows API, if you like the hard way of doing things. A much simpler solution is offered by the Microsoft Scripting Runtime library, that exposes a Drive object that lets you get all those info by querying a property: |
Click here to copy the following block |
Dim fso As New Scripting.FileSystemObject Dim drv As Scripting.Drive Dim info As String
For Each drv In fso.Drives info = "Drive " & drv.DriveLetter & vbCrLf info = info & " Type: " Select Case drv.DriveType Case Removable: info = info & "Removable" & vbCrLf Case Fixed: info = info & "Fixed" & vbCrLf Case CDRom: info = info & "CDRom" & vbCrLf Case Remote: info = info & "Remote" & vbCrLf Case RamDisk: info = info & "RamDisk" & vbCrLf Case Else: info = info & "Unknown" & vbCrLf End Select
If Not drv.IsReady Then info = info & " Not Ready" & vbCrLf Else info = info & " File System: " & drv.FileSystem & vbCrLf info = info & " Label: " & drv.VolumeName & vbCrLf info = info & " Serial number: " & drv.SerialNumber & vbCrLf info = info & " Total space: " & drv.TotalSize & vbCrLf info = info & " Free space: " & drv.FreeSpace & vbCrLf End If Text1.Text = Text1.Text & info Next |
|
|
|
Submitted By :
Nayan Patel
(Member Since : 5/26/2004 12:23:06 PM)
|
|
|
Job Description :
He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting. |
View all (893) submissions by this author
(Birth Date : 7/14/1981 ) |
|
|