ColonelBlue
Technical User
Hello.
Not sure if this is the right place to ask.
I am not an FSO expert by any means and we have been using a script to generate folder content listing on an asp page.
I am looking for a simple FSO search script that would be run on the parent folder for users to search for relevant files with a particular file name?
Thanks in advance for any help.
This is the script we're using:
Not sure if this is the right place to ask.
I am not an FSO expert by any means and we have been using a script to generate folder content listing on an asp page.
I am looking for a simple FSO search script that would be run on the parent folder for users to search for relevant files with a particular file name?
Thanks in advance for any help.
This is the script we're using:
if objFSO.FolderExists(strPhysicalPath) Then
dim x, xx, i, j, tempx
x = 0
For Each objFileItem In objFolderContents
x = x + 1
Next
tempx = x - 1
Dim temps( )
dim tempsd( )
redim temps(x)
redim tempsd(x)
xx = 0
For Each objFileItem In objFolderContents
temps(xx)=objFileItem.Name
tempsd(xx)=objFileItem.DateLastModified
xx = xx + 1
Next
if (sortbydate) then ''sorts folder contents by date
for i = tempx To 0 Step -1
for j = 0 to tempx
if tempsd(j) > tempsd(j+1) then
temp=temps(j+1)
temp2=tempsd(j+1)
temps(j+1)=temps(j)
tempsd(j+1)=tempsd(j)
temps(j)=temp
tempsd(j)=temp2
end if
next
next
x = 1
else
x = 0
end if
if (sortbydate) then
tempx = tempx + 1
for x = tempx To 1 Step -1
select case Ucase(right(temps(x),3))
case "PDF"
strImageType = "pdf.gif"
case "DOC"
strImageType = "doc.gif"
case "HTM"
strImageType = "IEXPLORE1.gif"
case "TML"
strImageType = "IEXPLORE1.gif"
case "XLS"
strImageType = "xls.gif"
case else
strImageType = "document.gif"
end select
if date < tempsd(x)+ strDays then
strNewFile="<font size=""1"" color=""red"" face=""arial"">updated" & strNewFile &"</b><br></font>"
else
strNewFile=""
end if
strLen = Len(temps(x))
if instr(temps(x),"~")=0 then
Response.Write "<img src=""images/doc_images/"& strImageType &""" border=""0"" align=""texttop"" vspace=""1""> <a href=""#"" Onclick=""javascript:Start_large('File:"&strPhysicalPath & Replace(replace(temps(x),"'","\'")," ", "%20")&"')""; class=""intranet"" onmouseover=""window.status=('" & strFolder & ": " & left(replace(Replace(temps(x),"_", " "),"'","\'"),strLen - 4) & "'); return true;"" onmouseout=""window.status=(' '); return true;"">" & left(Replace(temps(x),"_", " "),strLen - 4) & "</a>" & strNewFile&"<br>" & chr(13) & chr(10)
end if
Next
else
for x = 0 To tempx
select case Ucase(right(temps(x),3))
case "PDF"
strImageType = "pdf.gif"
case "DOC"
strImageType = "doc.gif"
case "HTM"
strImageType = "IEXPLORE1.gif"
case "TML"
strImageType = "IEXPLORE1.gif"
case "XLS"
strImageType = "xls.gif"
case else
strImageType = "document.gif"
end select
if date < tempsd(x)+ strDays then
strNewFile= "updated " & FormatDateTime(date,1)
else
strNewFile=""
end if
strLen = Len(temps(x))
if instr(temps(x),"~")=0 then
Response.Write "<img src=""images/doc_images/"& strImageType &""" border=""0"" align=""texttop"" vspace=""1""> <a href=""#"" Onclick=""javascript:Start_large('File:"&strPhysicalPath & Replace(replace(temps(x),"'","\'")," ", "%20")&"')""; class=""intranet"" onmouseover=""window.status=('" & strFolder & ": " & left(replace(Replace(temps(x),"_", " "),"'","\'"),strLen - 4) & "'); return true;"" onmouseout=""window.status=(' '); return true;"">" & left(Replace(temps(x),"_", " "),strLen - 4) & "</a><b><font size=""1"" color=""red"" face=""arial""> " & strNewFile &"</b><br></font>" & chr(13) & chr(10)
end if
Next
end if
Set objFile = Nothing
Set objFolder = Nothing
Set objFolderContents = Nothing
end if
Set objFSO = Nothing