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

Discussion in 'ASP General' started by Ajay Garg, Jan 14, 2004.

  1. Ajay Garg

    Ajay Garg Guest

    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
    Ajay Garg, Jan 14, 2004
    #1
    1. Advertising

  2. Ajay Garg

    Steven Burn Guest

    <%
    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:...
    > 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
    Steven Burn, Jan 14, 2004
    #2
    1. Advertising

  3. Ajay Garg

    Brynn Guest

    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



    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
    Brynn, Jan 14, 2004
    #3
  4. Ajay Garg

    spdl Guest

    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_scripts/script.asp?file=FilesInFolder.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
    spdl, Jan 14, 2004
    #4
  5. Ajay Garg

    Curt_C [MVP] Guest

    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_scripts/script.asp?file=FilesInFolder.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

    >
    >
    Curt_C [MVP], Jan 14, 2004
    #5
  6. Ajay Garg

    spdl Guest

    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_scripts/script.asp?file=FilesInFolder.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

    > >
    > >

    >
    >
    spdl, Jan 14, 2004
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. mrmagoo
    Replies:
    6
    Views:
    9,309
    Revathishre
    May 6, 2011
  2. Angus Comber
    Replies:
    1
    Views:
    607
    Ben Pfaff
    Jan 22, 2004
  3. Nathan Sokalski
    Replies:
    2
    Views:
    1,129
  4. Ben Johnson

    Loop through files in a directory

    Ben Johnson, May 4, 2007, in forum: Ruby
    Replies:
    2
    Views:
    294
  5. Isaac Won
    Replies:
    9
    Views:
    372
    Ulrich Eckhardt
    Mar 4, 2013
Loading...

Share This Page