Print Page | Close Window

SubFolders Sort

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=27678
Printed Date: 29 March 2026 at 8:34pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: SubFolders Sort
Posted By: dwhite02
Subject: SubFolders Sort
Date Posted: 11 August 2009 at 11:58pm
Hi everyone,
 
I am setting up pa page to display a list of subfolders. Easy enough with the code (1) below. However I have a requirement to sort the folders in various ways such as DateLastModified and Folder name descending.
 
I have found posts on other forums giving code examples using arrays which have had limited success.
 
Can anyone point me at a working example? Thanks.
 
(1)
--------------------------------
<%
dim fs,fo,x
set fs=Server.CreateObject("Scripting.FileSystemObject")
set fo=fs.GetFolder("c:\test\")

for each x in fo.SubFolders
  'Print the name of all subfolders in the test folder
  Response.write(x.Name & "<br />")
next

set fo=nothing
set fs=nothing
%>
 
-----------------------------

 



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net