Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FSO FileExists and wildcards

Status
Not open for further replies.

croydon

Programmer
Apr 30, 2002
253
0
0
EU
Is it possible to use wildcards with FSO.FileExists? The following does not appear to work:

If FSO.FileExists("c:\tempdir\*.*") = True Then
FSO.DeleteFile("c:\tempdir\*.*", True)
End If

Any suggestions would be appreciated.
 
croydon,

It is a No.

If you really want to check something is there, do this instead?
[tt]
if fso.getfolder("c:\tempdir").files.count<>0 then
'do something as shown
end if
[/tt]
Sure there are lot of other ways to look at the same thing.

regards - tsuji
 
Further note:

Just in case you did not notice, take out the parentheses.
[tt]
FSO.DeleteFile "c:\tempdir\*.*", True
[/tt]
- tsuji
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top