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!

Opening multiple files in a directory 1

Status
Not open for further replies.

fpgiv

Programmer
Oct 1, 2003
91
0
0
US
Hi, does anyone know a quick and easy way to loop through every file in a directory and open it? (Then get some data, close the file, and move to the next one)
Thanks.
 
You could try a simpler way
Code:
dir=Server.MapPath(".")
set fso=Server.CreateObject("Scripting.FileSystemObject")
set f=fso.GetFolder(dir)
set files=f.Files

for each file in files
 fname=file.Name
 'code here
next
also you can find help here
File
Files Collection
FileSystemObject

________
George, M
Searches(faq333-4906),Carts(faq333-4911)
 
Thanks shaddow. That is exactly what I was looking for.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top