basic fileSystemObject question

Results 1 to 4 of 4

Thread: basic fileSystemObject question

  1. #1
    Ed Leach Guest

    Default basic fileSystemObject question

    I&#039;m able to create and use the file system object in order to get a collection of file names from a directory and I&#039;m able to get a count of the number of files in the directory:<BR><BR>----<BR>set myDirectory=Server.CreateObject("Scripting.FileSys temObject")<BR>set myFiles=MyDirectory.GetFolder(Server.MapPath("pics/"))<BR><BR>myFileCount = myFiles.files.count<BR>----<BR><BR>What is the right syntax for getting the name of the (for example) 7th file in the directory? Although this is not right, this is what I&#039;m trying to get:<BR><BR> myFileName = myFiles.files(7).name<BR> <BR>What is the right syntax?<BR><BR>Thanks,<BR><BR>- Ed

  2. #2
    bugo Guest

    Default i think it would work that way.

    have u tried it???

  3. #3
    Ed Guest

    Default RE: i think it would work that way.

    Yes I&#039;ve tried it and I get the error:<BR><BR> "Invalid procedure call or argument"<BR><BR>- Ed

  4. #4
    bugo Guest

    Default make a for each loop

    and put inside a counter

Posting Permissions

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