<% If Request.Cookies("Webmaster") <> "Validated" Then Response.Redirect("/ctrfiles/stats/login.asp") End if Response.Buffer = True Function ShowImageForType(strName) Dim strTemp strTemp = strName If strTemp <> "dir" Then strTemp = LCase(Right(strTemp, Len(strTemp) - InStrRev(strTemp, ".", -1, 1))) End If Select Case strTemp Case "asp" strTemp = "asp" Case "dir" strTemp = "dir" Case "htm", "html" strTemp = "htm" Case "gif", "jpg" strTemp = "img" Case "txt" strTemp = "txt" Case "cnt" strTemp = "txt" Case Else strTemp = "misc" End Select strTemp = "" ShowImageForType = strTemp End Function %> <%' Now to the Runtime code: Dim strPath Dim objFSO Dim objFolder Dim objItem if Request.Querystring("PATH") = "" then strPath = "/images/" else strPath = Request.Querystring("PATH") end if Set objFSO = Server.CreateObject("Scripting.FileSystemObject") Set objFolder = objFSO.GetFolder(Server.MapPath(strPath)) %> --Administration--
Contents of <%= strPath %>
<%= ShowImageForType("dir") %> Images Dir

<% count = 0 For Each objItem In objFolder.SubFolders If InStr(1, objItem, "_vti", 1) = 0 Then %> <% count = count + 1 End If Next Set objItem = Nothing Set objFolder = Nothing Set objFSO = Nothing %>
Delete Folders and Counter Files
File Name: File Size: Date Created: File Type: Delete:
<%= ShowImageForType("dir") %> <%= objItem.Name %> <%= objItem.Size %> <%= objItem.DateCreated %> <%= objItem.Type %> (<%=count%>) Delete