<% dim aryURL, URLvar aryURL = Split(Request.ServerVariables("SCRIPT_NAME"), "/", -1, 1) URLvar = aryURL(ubound(aryURL)) if request.querystring("sPP")<>"" then sPP=request.querystring("sPP") & "\" ParentVar="<a href=""#"" onClick=""history.go(-1)"">Parent Directory</a><br><br>" & vbCrLF else sPP = "\\serverlocation\" end if Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.GetFolder(sPP) Set fc = f.Files Set ff = f.SubFolders For Each f1 in ff HeaderVar=HeaderVar& "<a href=""" & URLvar & "?sPP=" & sPP & f1.name & """>" & f1.name & "</a> | " & vbCrLF Next For Each f1 in fc SubHeaderVar=SubHeaderVar& "<a href=""" & sPP & f1.name & """>" & f1.name & "</a> <br>" & vbCrLF Next Set ff = nothing Set fso = nothing Set f = nothing Set fc = nothing response.write ParentVar if HeaderVar<>"" then response.write "<b>Folders" & vbCrLF & "<br><br> | " & vbCrLF & HeaderVar & "</b><br><br>" & vbCrLF if SubHeaderVar<>"" then response.write "<b>Files</b>" & vbCrLF & "<br><br>" & vbCrLF & SubHeaderVar & vbCrLF %>
You need to create an account or log in to post comments to this site.