Results 1 to 3 of 3

Thread: Does a file exist?

  1. #1
    Guest

    Question

    How do i find out if a specific file (in this case an ".exe") exists?

  2. #2
    Guest
    Use the Dir() function.
    Code:
    If Dir$("MyFile") <> "" Then MsgBox ("File exsist")

  3. #3
    Hyperactive Member
    Join Date
    Aug 2000
    Posts
    258
    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
    Visual Basic 6 SP4 on win98se

    QUIT THE RAT RACE BECAUSE YOUR MESSING THE WORLD UP !!!!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width