FSO is overkill in this situation. VB has a built-in function Dir(), which returns the filename if the file exists, or "" if it doesn't. i.e.
If Dir("C:\Autoexec.bat) <> "" Then ...
---------------------
Public Function FileExists(File As String) As Boolean
On Error Resume Next
FileExists = (Dir$(File) <> ""
On Error Goto 0
End Function
---------------------
Hope that helps!
~Mike
Any man willing to sacrifice liberty for security deserves neither liberty nor security.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.