-
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!
-
-
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