Results 1 to 2 of 2

Thread: How to find the correct drive letter of a hard drive

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2000
    Location
    Atlanta, GA
    Posts
    177

    How to find the correct drive letter of a hard drive

    Hello, I'm writing a program that needs to find the correct letter of the hard drive no matter what it is. Does any one have some simple sample code to do this? Thanks!
    212 will lead you to the truth

  2. #2
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    VB Code:
    1. Private Sub Command1_Click()
    2.     Dim fso As New FileSystemObject
    3.     Dim drv As Drive
    4.     On Error Resume Next
    5.     For Each drv In fso.Drives
    6.         Debug.Print drv.DriveLetter
    7.         Debug.Print drv.AvailableSpace
    8.         Debug.Print drv.DriveType
    9.         Debug.Print drv.FileSystem
    10.         Debug.Print drv.FreeSpace
    11.         Debug.Print drv.IsReady
    12.         Debug.Print drv.Path
    13.         Debug.Print drv.RootFolder
    14.         Debug.Print drv.SerialNumber
    15.         Debug.Print drv.ShareName
    16.         Debug.Print drv.TotalSize
    17.         Debug.Print drv.VolumeName
    18.     Next drv
    19. End Sub
    -= a peet post =-

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