Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Search entire drive for a file
Message
 
 
To
28/02/2003 15:20:16
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00759634
Message ID:
00759660
Views:
27
>I know this has been posted before, but I cannot locate it using the search feature for some reason. I need the ability to search an entire drive for a specific file 'archeadr.dbf' and it needs to function on Win95, Win98, Win2k, and WinXP without having to install WSH or anything else. Will an API function work?
>
>Any ideas anyone?
>
>TIA,
Tracy,

You can use filer.dll that comes with VFP.
oFiler = CREATEOBJECT('Filer.FileUtil')
oFiler.SearchPath = "C:\"
oFiler.FileExpression = 'eula.txt'
oFiler.SubFolder = .T.

WAIT WINDOW NOWAIT "Searching for '" + oFiler.FileExpression + "'. Be patient ..."
? oFiler.Find(0)
WAIT CLEAR
? oFiler.Files.Count
FOR i=1 TO oFiler.Files.Count
	? oFiler.Files.Item(i).Name
	?? " -", oFiler.Files.Item(i).Path
ENDFOR
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform