Forums
This topic is locked
Count folders
Posted 21 years ago
1
has voted
21 years ago Rene Bandsma posted:
I want to count how many folders I have in the folder where the ASP script is also processed....Ideas?
Replies
Replied 21 years ago
21 years ago Phil Shevlin replied:
<pre id=code><font face=courier size=2 id=code>
<%
Dim objFSO
Set objFSO = Server.CreateObject("Scripting.FileSystemObject"
'Get the folder object associated with the directory
Dim objFolder
Set objFolder = objFSO.GetFolder("c:/path/to/your/folder/"
' show count of subfolders
Response.Write objFolder.subFolders.count
'Clean up!
Set objFolder = Nothing
Set objFSO = Nothing
%>
</font id=code></pre id=code>
<%
Dim objFSO
Set objFSO = Server.CreateObject("Scripting.FileSystemObject"

'Get the folder object associated with the directory
Dim objFolder
Set objFolder = objFSO.GetFolder("c:/path/to/your/folder/"

' show count of subfolders
Response.Write objFolder.subFolders.count
'Clean up!
Set objFolder = Nothing
Set objFSO = Nothing
%>
</font id=code></pre id=code>
Replied 21 years ago
21 years ago Rene Bandsma replied:
<b>S U P E R</b>
I've been looking for this over 2 weeks... and it works great!
Thanks
I've been looking for this over 2 weeks... and it works great!
Thanks