How do i find out if a specific file (in this case an ".exe") exists?
Printable View
How do i find out if a specific file (in this case an ".exe") exists?
Use the Dir() function.
Code:If Dir$("MyFile") <> "" Then MsgBox ("File exsist")
Code:Public Function FileCheck(Path$) As Boolean
'USAGE: If FileCheck("C:\windows\kewl.exe") then msgbox "it was found"
FileCheck = True 'Assume Success
On Error Resume Next
Dim Disregard As Long
Disregard = FileLen(Path)
If Err <> 0 Then FileCheck = False
End Function