Visual Basic Programming Code Examples
Visual Basic > Code Snippets Code Examples
Checks whether a drive exists
1
2
3
4
5
6
7
8
9
10
11
12
13
Checks whether a drive exists
'This program checks whether a drive exists
Private Sub Form_Load()
Dim objfso As New FileSystemObject
If objfso.DriveExists("h:") Then
MsgBox "The Drive Exists", vbInformation
Else
MsgBox "The Drive does not exist", vbInformation
End If
End Sub