Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
 
 
 
500MB 27GB Web Hosting - $9.95/Month
 
 
 
 
 
Old Pages
 
Old Index
Site Map
What's New
 
Books
How To
Tips & Tricks
Tutorials
Stories
Performance
Essays
Links
Q & A
New in VB6
Free Stuff
Pictures
 
 
 
TitleSee if the floppy drive is empty
Keywordsfloppy, drive, empty
CategoriesTips and Tricks
 
Use Dir$. If the drive is empty, the program gets a "Bad file name or number" error.

Note that this assumes you know the floppy drive letter.

 
Private Sub Command1_Click()
Dim txt As String

    Screen.MousePointer = vbHourglass
    DoEvents

    On Error Resume Next
    txt = Dir$("A:\*.*")
    If Err.Number = 52 Then
        Label1.Caption = "Drive is empty"
    Else
        Label1.Caption = "Drive is not empty"
    End If

    Screen.MousePointer = vbDefault
End Sub
 
Formatted by Neil Crosby
 
 
Copyright © 1997-2003 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated