List folder files in a spec dir

Results 1 to 2 of 2

Thread: List folder files in a spec dir

  1. #1
    Join Date
    Dec 1969

    Default List folder files in a spec dir

    Here is the working code for this problem. It will create the column with the file names in the list.txt file what I can easily use in a db. But, I would like to add the file size separated with a "," and some other file attributes to the same line in the .txt. I would also like to use MapPath instead of the full path in the script. Any idea? Thanks <BR><BR>&#060;% <BR>Dim objFSO,objFOLDER,objFILE,objTEXT <BR><BR>Set objFSO=Server.CreateObject("Scripting.FileSystemOb ject") <BR>Set objFOLDER=objFSO.GetFolder("(the full path)ENGpdf_out") <BR>Set objTEXT=objFSO.CreateTextFile("(the full path)ENGlist.txt") <BR>For Each objFILE In objFOLDER.Files <BR><BR> &#039;Response.Write(objFILE.Name) & "" <BR> objTEXT.WriteLine(objFILE.Name) &#039;+ size + date etc. <BR><BR>Next <BR><BR>Set objFILE=Nothing <BR>Set objFOLDER=Nothing <BR>Set objFSO=Nothing <BR>Set objTEXT=Nothing <BR>%&#062;

  2. #2
    Join Date
    Dec 1969

    Default Check out the documentation for...

    ...the FileSystemObject:<BR><BR><BR><BR>In particular the bit about the FileObject:<BR><BR><BR><BR>That has all the stuff you need.<BR><BR>With regards to MapPath: What do you mean? You want the MapPath instead of the full path? Can you give an example?<BR><BR>Oliver.

Posting Permissions

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