Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Search entire drive for a file
Message
 
 
À
28/02/2003 15:20:16
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00759634
Message ID:
00759660
Vues:
29
>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--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform