Progged programming site

Programming source code, articles, tutorials, links and chat

Display all drives with Visual basic

This Visual basic example displays all drives on your system, you will need to place a combo box on the form.

Private Sub Form_Load()

Dim objfso As Scripting.FileSystemObject
Dim objDrives As drives, objDrive As drive
Set objfso = CreateObject(”Scripting.FileSystemObject”)
Set objDrives = objfso.drives

For Each objDrive In objobjDrives
Combo1.AddItem objDrive.DriveLetter
Next

End Sub

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Sponsors