• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 730
  • Last Modified:

VB6 DriveListBox-Show only Fixed Drives

Is there a way in a drivelistbox to only show the fixed drives in VB6?  I only want the fixed drives to be available to the user, not mapped network drives or others. Any help greatly appreciated.
0
shubbell
Asked:
shubbell
  • 2
1 Solution
 
jbilCommented:
you could..
Add a reference to scrrun.dll

and use something like this..

Private Sub Drive1_Change()
Dim fs, d, t
    Set fs = CreateObject("Scripting.FileSystemObject")
    Set d = fs.GetDrive(Drive1.Drive)
    Select Case d.DriveType
       
        Case 2: t = "Fixed"
        'your stuff here
        Debug.Print "fixed"
        Case Else
        MsgBox "Drive not available"
       
    End Select
   
End Sub
0
 
jbilCommented:
Other way, make drivebox invisible
loop thru and move only fixed drives to a visible listbox.
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now