Forums

ASP

This topic is locked

Count folders

Posted 24 Jan 2004 13:58:55
1
has voted
24 Jan 2004 13:58:55 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 25 Jan 2004 02:44:42
25 Jan 2004 02:44:42 Phil Shevlin replied:
<pre id=code><font face=courier size=2 id=code>
&lt;%
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
%&gt;
</font id=code></pre id=code>
Replied 25 Jan 2004 14:29:40
25 Jan 2004 14:29:40 Rene Bandsma replied:
<b>S U P E R</b>

I've been looking for this over 2 weeks... and it works great!

Thanks

Reply to this topic