Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
MSDN Visual Basic Community
 
 
 
 
 
 
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-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated