Visual Basic > Code Snippets
Check if a file exists
Check if a file exists Private Sub Form_Load() 'Replace the 'c:\autoexec.bat' with the file you wish to find If Dir$("c:\autoexec.bat") <> "" Then MsgBox ("The file exists") Else MsgBox ("The file does not exist") End If End Sub
Visual Basic Codes
ActiveX
Miscellaneous
Applications
Code Snippets
Common Dialogs
Special Effects
Database Stuff
Date Time
Files Drives
Forms
Graphics Games
Internet Stuff
Multimedia
Other
Strings
Windows