Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Files collection

Status
Not open for further replies.

DanColin

Technical User
Jul 14, 2002
4
0
0
US
How can I sort the list of files into alphabetical order contained in the files collection returned by the FolderObject. Thanks.
 
<%
Dim objFileScripting, objFolder
Dim filename, filecollection, strDirectoryPath, strUrlPath
strDirectoryPath=&quot;F:\inetpub\ strUrlPath=&quot;\folder\&quot;

'get file scripting object
Set objFileScripting = CreateObject(&quot;Scripting.FileSystemObject&quot;)
'Return folder object
Set objFolder = objFileScripting.GetFolder(&quot;F:\inetpub\ 'return file collection In folder
Set filecollection = objFolder.Files
'create the links
For Each filename In filecollection
Filename=right(Filename,len(Filename)-InStrRev(Filename, &quot;\&quot;))
If filename <> &quot;default.asp&quot; then
Response.Write &quot;<A HREF=&quot;&quot;&quot; & strUrlPath & filename & &quot;&quot;&quot;>&quot; & filename & &quot;</A><BR>&quot;
End if
Next
%>
star.gif
if I helped. [wink]
s_vzio.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top