How do I order a File Collection?

Results 1 to 3 of 3

Thread: How do I order a File Collection?

  1. #1
    Simon Brotherton Guest

    Default How do I order a File Collection?

    How can I order the Files Collection of the scripting object? I need to display files ordered by their creation date - decending. I just can&#039t get it to work. How can I do this?

  2. #2
    Kranthi Dandamudi Guest

    Default RE: How do I order a File Collection?

    May be this should help you<BR><BR>folder is the path to the folder<BR>folder = /test/files/<BR>Let the argument be (server.mappath(folder)) instead od folder<BR><BR>Sub ShowFileInfo(folder)<BR> Dim fs, f, s<BR> Set fs = CreateObject("Scripting.FileSystemObject")<BR> Set f = fs.GetFile(folder)<BR> s = f.DateCreated<BR> MsgBox s<BR>End Sub<BR>

  3. #3
    Simon Brotherton Guest

    Default RE: How do I order a File Collection?

    Thanks for your answer!<BR><BR>However, I am aware of this... Can I assume that there is no way to tell VBScript or JScript that I want the file collection in a particular order?<BR><BR>I know that I could read all values of the collection into an array, sort the array, then read the required items, but this is not really the kind of thing that enhances performance in an interpreted language!<BR><BR>Do you have any further ideas?<BR><BR>Thanks<BR><BR>Simon Brotherton

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •