VBDesigns
asked on
How do I search for a file?
What's the best method to search for a file on the hard drive on Win9x, NT, and Win2000 systems?
I need to find out if my application was already installed, and if so, where... Of course I could write out a registry entry, but without this, what's the next best method?
I need to find out if my application was already installed, and if so, where... Of course I could write out a registry entry, but without this, what's the next best method?
Ooops...the above only works if you know tht path. Sorry.
ASKER
If I knew the path I wouldn't have to search! Sorry, I don't see how this answer applies unless the external call searches all hard drives and returns a directory.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I only have VB6. I'll have to install the samples I guess. I was just hoping there was a way to hook into the OS file search mechanism...
If you like, I can e-mail it to you.
Comment me your e-mail address.
Comment me your e-mail address.
ASKER
Actually, I went ahead and used the registry for what I needed to do. I'll give you the points for answering though - thanks!
Thanks and you are welcome.
Happy new year.
Happy new year.
Dim sFile$
sFile = "Name And Path Of Your File"
Dim fs As Object
Set fs = CreateObject("Scripting.Fi
If fs.fileexists(sFile$) = True Then
MsgBox "File Exists...Your code here!"
Else
MsgBox "Does Not Exist...Your code here!"
End If
Set fs = Nothing