<HTML>
<BODY>
<FORM METHOD=POST ACTION="resultados.Asp">
Palabra a buscar:
<INPUT TYPE=TEXT NAME=texto_a_buscar>
<P>
<INPUT TYPE=SUBMIT VALUE="Buscar">
</FORM>
</BODY>
</HTML>
------ Pagina resultados.asp
<HTML>
<BODY>
<B>Buscar resultados en <%=Request("texto_a_buscar")%></B><BR>
<%
Const fsoForReading = 1
Dim strtexto_a_buscar
strtexto_a_buscar = Request("texto_a_buscar")
Dim objFSO
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Dim objFolder
'el path de la carpeta en la que queremos realizar la busqueda
Set objFolder = objFSO.GetFolder(Server.MapPath("/carpeta_prueba"))
Dim objFile, objTextStream, strFileContents, bolFileFound
bolFileFound = False
For Each objFile in objFolder.Files
If Response.IsClientConnected then
Set objTextStream = objFSO.OpenTextFile(objFile.Path,fsoForReading)
strFileContents = objTextStream.ReadAll
If InStr(1,strFileContents,strtexto_a_buscar,1) then
Response.Write "<LI><A HREF=""/carpeta_prueba/" & objFile.Name & _
""">" & objFile.Name & "</A><BR>"
bolFileFound = True
End If
objTextStream.Close
End If
Next
if Not bolFileFound then Response.Write "No se encontraron resultados"
Set objTextStream = Nothing
Set objFolder = Nothing
Set objFSO = Nothing
%>
</BODY>
</HTML>