Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Retreiving filenames from directories
Message
From
26/02/1999 19:56:06
 
 
To
26/02/1999 15:41:52
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00192142
Message ID:
00192226
Views:
22
>How do I retreive each file name under a particular directory and add those names to a VFP table?

You can use ADIR() to retrieve the list of files into an array, and then append the array into your table. There are also automation objects like Scripting.FileSystemObject that can make traversing an entiure folder hierarchy fairly easy.

Try ADIR() first; if you want to investigate Scripting.FileSystemObject, install the Windows Scripting Host, and look at the MSDN topic FileSystemObject object. You might also take a look at the Web site http://cwashington.netreach.net/home.htm for some good discussions on scripting and the scripting host in detail.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform