469,286 Members | 2,419 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,286 developers. It's quick & easy.

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

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
Jul 19 '05 #1
5 10296
<%
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)
Ajay Garg <aj*****@hotmail.com> wrote in message
news:d9**************************@posting.google.c om...
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

Jul 19 '05 #2

Try this function out, it will return an single-dimensional array with
all of the file names.
http://www.coolpier.com/cp/cp_script....asp&view=code
Brynn
www.coolpier.com

On 13 Jan 2004 17:18:41 -0800, aj*****@hotmail.com (Ajay Garg) wrote:
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
Jul 19 '05 #3

Would there be a way to get all hierachies and not only one level?

ralph

"Brynn" <z@z.com> wrote in message
news:40**************@news.comcast.giganews.com...

Try this function out, it will return an single-dimensional array with
all of the file names.
http://www.coolpier.com/cp/cp_script....asp&view=code

Brynn
www.coolpier.com

On 13 Jan 2004 17:18:41 -0800, aj*****@hotmail.com (Ajay Garg) wrote:
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

Jul 19 '05 #4
make the call recursive, having each subdir call the function again

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"spdl" <sp**@mosaic.ca> wrote in message
news:O4**************@tk2msftngp13.phx.gbl...

Would there be a way to get all hierachies and not only one level?

ralph

"Brynn" <z@z.com> wrote in message
news:40**************@news.comcast.giganews.com...

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

http://www.coolpier.com/cp/cp_script....asp&view=code


Brynn
www.coolpier.com

On 13 Jan 2004 17:18:41 -0800, aj*****@hotmail.com (Ajay Garg) wrote:
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


Jul 19 '05 #5
Do you know about an example for this. Sounds rather complicated...

thanks

"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:e2****************@TK2MSFTNGP11.phx.gbl...
make the call recursive, having each subdir call the function again

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"spdl" <sp**@mosaic.ca> wrote in message
news:O4**************@tk2msftngp13.phx.gbl...

Would there be a way to get all hierachies and not only one level?

ralph

"Brynn" <z@z.com> wrote in message
news:40**************@news.comcast.giganews.com...

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

http://www.coolpier.com/cp/cp_script....asp&view=code


Brynn
www.coolpier.com

On 13 Jan 2004 17:18:41 -0800, aj*****@hotmail.com (Ajay Garg) wrote:

>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



Jul 19 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by chris | last post: by
10 posts views Thread by Chris | last post: by
5 posts views Thread by matt dittman | last post: by
3 posts views Thread by Joe | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.