How do we use the file system object to loop through a directory and refresh all the files?

A

Ajay Garg

I wanted to loop through a directory and get the names of all the
files in the directory and put it in a table using the file system
object and VB scrip in a DTS package...


How can Ido this?


Thansk in advance.


Ajay
 
S

Steven Burn

<%
Dim FSO
Dim Fl
Dim Fls
Set FSO = CreateObject("Scripting.FileSystemObject")
Set Fls = FSO.GetFolder(Server.MapPath("./")) './ is the current folder

For Each Fl in Fls
Response.Write Fl.Name & "<br>"
Next

Set Fl = Nothing
Set Fls = Nothing
Set FSO = Nothing
%>
--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)
 
B

Brynn

Try this function out, it will return an single-dimensional array with
all of the file names.


http://www.coolpier.com/cp/cp_scripts/script.asp?file=FilesInFolder.asp&view=code


Brynn
www.coolpier.com



I wanted to loop through a directory and get the names of all the
files in the directory and put it in a table using the file system
object and VB scrip in a DTS package...


How can Ido this?


Thansk in advance.


Ajay

I participate in the group to help give examples of code. I do not guarantee the effects of any code posted. Test all code before use!

Brynn
www.coolpier.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top