How can I determine if a file exists in a given directory?
Printable View
How can I determine if a file exists in a given directory?
use the DIR function.. explantion in VB help
I dont have MSDN, can you pls show the code here?
VB Code:
Dim fso as fileSystemObject msgbox fso.fileExists("C:\whateverfile.whatever")
You need a reference from your project to Microsoft Scripting Runtime library.
You don't need MSDN, just standard VB help files.. :rolleyes:Quote:
Originally posted by eimroda
I dont have MSDN, can you pls show the code here?
If Dir ("c:\windows\test.txt") <> "" Then
'It Exists
Else
'It doesn't
End If
Thank you skald2k! I'll give your code a try... :)
VB Code:
If Dir$([i]path[/i]) <> "" Then 'The File Exists Else 'The File Does Not Exist End If
Thank you all guys! I got it!!!! :D
No prob :)