Results 1 to 3 of 3

Thread: How to get avaliable drives using vb

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2002
    Posts
    83

    How to get avaliable drives using vb

    hi all,

    can anybody hell me how to get the avaliable system drives with the help of vb?

    pradip

  2. #2
    PowerPoster
    Join Date
    Jul 2002
    Location
    Dublin, Ireland
    Posts
    2,148
    Using the EventVB.dll you can do this thus:

    VB Code:
    1. Option Explicit
    2.  
    3. Dim vbLink As EventVB.ApiFunctions
    4.  
    5. Public Sub ListDrives()
    6.  
    7. If vbLink Is Nothing Then
    8.    Set vbLink = New ApiFunctions
    9. End If
    10.  
    11. Dim volThis As ApiVolume
    12.  
    13. For Each volThis In vbLink.System.Volumes
    14.    Debug.Print volThis.Volumename & " - " & volThis.SerialNumber
    15. Next volThis
    16.  
    17. End Sub

    HTH,
    Duncan

  3. #3
    Frenzied Member moinkhan's Avatar
    Join Date
    Jun 2000
    Location
    Karachi, Pakistan
    Posts
    2,011
    Or put a drivelist and use this (you will not have to use a full megabyte dll)
    VB Code:
    1. For x = 0 To Drive1.ListCount - 1
    2.     Debug.Print Drive1.List(x)
    3. Next
    You will need a drive listbox for this...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width