Click to See Complete Forum and Search --> : Finding a file in a directory


venkytvs
January 26th, 2000, 10:34 PM
Hi all

Can anybody give me an idea for Finding a file in a particular directory(incliding wildcards). I tried using FSO but it is not working with wildcards.


Thanks in advance
Venky

January 27th, 2000, 12:20 AM
Hi,

Hi Venky,

Finding a single file or Directory using (GetFile attributes)Win 32 API is possible. But if you use wild card search it will not work.
You have to give the full path of a file/ Directory in the API. If you need the code (very simple) I can send. FSO I have tried. But
in that case also if it is wild card search you won't get. It appears, basically you have to give individual file / directory path in any
case.

Bye,

satya
Email : snchandu@hotmail.com

Lothar Haensler
January 27th, 2000, 01:10 AM
you can use VB's built-in Dir function:

dim strfile as string
strfile = Dir("c:\winnt\system32\*.dll")
do while strfile <> ""
debug.print strfile
strfile = dir
Loop