Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > How do we use the file system object to loop through a directory and refresh all the files?

Reply
Thread Tools

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

 
 
Ajay Garg
Guest
Posts: n/a
 
      01-14-2004
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
 
Reply With Quote
 
 
 
 
Steven Burn
Guest
Posts: n/a
 
      01-14-2004
<%
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 <> wrote in message
news: 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



 
Reply With Quote
 
 
 
 
Brynn
Guest
Posts: n/a
 
      01-14-2004

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, (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
 
Reply With Quote
 
spdl
Guest
Posts: n/a
 
      01-14-2004

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

ralph

"Brynn" <> wrote in message
news:...
>
> 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, (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



 
Reply With Quote
 
Curt_C [MVP]
Guest
Posts: n/a
 
      01-14-2004
make the call recursive, having each subdir call the function again

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com


"spdl" <> wrote in message
news:...
>
> Would there be a way to get all hierachies and not only one level?
>
> ralph
>
> "Brynn" <> wrote in message
> news:...
> >
> > 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, (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

>
>



 
Reply With Quote
 
spdl
Guest
Posts: n/a
 
      01-14-2004
Do you know about an example for this. Sounds rather complicated...

thanks

"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:e2iiS%...
> make the call recursive, having each subdir call the function again
>
> --
> Curt Christianson
> Owner/Lead Developer, DF-Software
> www.Darkfalz.com
>
>
> "spdl" <> wrote in message
> news:...
> >
> > Would there be a way to get all hierachies and not only one level?
> >
> > ralph
> >
> > "Brynn" <> wrote in message
> > news:...
> > >
> > > 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, (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

> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Triple nested loop python (While loop insde of for loop inside ofwhile loop) Isaac Won Python 9 03-04-2013 10:08 AM
how to loop through a directory and hyperlink to all files mrmagoo ASP .Net 6 05-06-2011 06:50 AM
System.IO.Directory.GetDirectories() and System.IO.Directory.GetFiles() are not returning the specified directory Nathan Sokalski ASP .Net 2 09-06-2007 03:58 PM
newbie question: loop through directory and change file names lawrence Java 2 11-20-2004 06:14 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57