Results 1 to 3 of 3

Thread: find file...gotta be easy!

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 1999
    Location
    Columbia, SC USA
    Posts
    374

    Cool

    hey guys -

    can someone show me how to search for a particular file on a user's hard drive and return the path?

    e.g. if I want to find MyProgram.exe, and the route is C:\Programs\MyProgram\MyProgram.exe, what function or API call could I use to pass in the filename MyProgram.exe and return C:\Programs\MyProgram, or a null string if the file does not exist on the hard drive?

    thanks man, I know this has to be easy but I can't get started on it!

  2. #2
    Frenzied Member Jop's Avatar
    Join Date
    Mar 2000
    Location
    Amsterdam, the Netherlands
    Posts
    1,986
    http://www.vbsquare.com/tips/tip229.html
    This what you need?

    Or maybe this one is better:
    http://www.vb-world.net/tips/tip59.html

    Have fun!
    Jop - validweb.nl

    Alcohol doesn't solve any problems, but then again, neither does milk.

  3. #3
    Guest
    If you know the file and where it is, you can see if it exists using the Dir function.

    Code:
    If Dir("C:\Program Files\MyProgram.exe") <> "" Then
    Msgbox "file exists"
    Else
    Msgbox "file not found"
    End If

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