<%
'Capture the name of the page as well as ' directory structure
script_name=Request.ServerVariables("script_name")

'Split the directory tree into an arry b ' y /
split_name=Split(script_name,"/")

' Sets the number of directory levels do ' wn
num_directory=UBound(split_name)-1

%>

CodeAve.com(Directory Size)









<%
' Create a file system object to read al ' l the directories
' beneath the current directory split_na ' me(num_directory)
' You can hard code the directory name i ' f you like
Set directory=Server.CreateObject("scripting.filesystemobject")
Set allfiles=directory.getfolder(Server.MapPath("../"& split_name(num_directory)& "/"))

' Lists all the files found in the direc ' tory
For Each directory In allFiles.subfolders
' Removes certain MSFrontPage was direct ' ories
If Right(directory.Name,3) <> "cnf" Then
'Adds the folder sizes up for a total< ' ;BR> total_size=total_size + directory.size %>







<% End If 'end check For FrontPage directories
Next 'end of the For next Loop %>







Directory

Megabytes

Kilobytes

Bytes

<%= directory.name %>
<%= FormatNumber((directory.size/1024/1024),2) %> <%= FormatNumber((directory.size/1024),0) %> <%= FormatNumber(directory.size,0) %>
Total <%= FormatNumber((total_size/1024/1024),2) %> <%= FormatNumber((total_size/1024),0) %> <%= FormatNumber(total_size,0) %>