<%@ LANGUAGE = "VBScript" %>
<%
    Dim fs, f, f1, fc, s
    Set fs = CreateObject("Scripting.FileSystemObject")
    Set f = fs.GetFolder(Server.MapPath("./"))
    Set fc = f.SubFolders
    Set ff = f.files
    	ForReading = 1
	ForWriting = 2
	ForAppending = 3

For Each f1 in ff
	if lcase(Right(f1.Name, 4)) = ".asp" and Not lcase(f1.name) ="test.asp" Then

		contents = ""

		Set ReadFile = fs.OpenTextFile(Server.MapPath("./") & "\" & f1.name, ForReading, False, 0)
		Contents = ReadFile.ReadAll
		set ReadFile = Nothing

		set file = fs.opentextfile(Server.MapPath("./") & "\" & f1.name, ForWriting, 0)

		file.Write ("<!--#include virtual=""/includes/topofpage.asp""-->") & VbCrLf
		file.Write (Contents)

		file.close

		set file = nothing

		%><%=f1.name%>* processed<br><%
	End IF
Next

Set fs = Nothing

%>
