Check If File Exist

'Insert the following code to your form:

Private Sub Form_Load()
'Replace the 'c:\autoexec.bat' with then name of the file (with his path) that
'you want to check his existence

If Dir$("c:\autoexec.bat") <> "" Then
MsgBox ("The file exist")
Else
MsgBox ("The file does not exist")
End If
End Sub

Go Back