<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%> <% Response.Buffer = True sSiteRoot = Server.Mappath(".") & "\" sFile = Server.Mappath(".") & "\output\" aPages = Array("home","profile","our_location","contact_us","enquire") aFolders = Array("skin\images","skin\css","skin\js","custpics") aNewFolders = Array("images","css","js","custpics") Set oFS = Server.CreateObject("Scripting.FileSystemObject") For i = 0 to uBound(aFolders) oFS.CopyFolder sSiteRoot & aFolders(i),sFile & aNewFolders(i) Next Set oXML = Server.CreateObject("Microsoft.XMLHTTP") For i = 0 to uBound(aPages) Set oFile = oFS.CreateTextFile(sFile & aPages(i) & ".html",true) oXML.Open "GET", "http://localhost/gearboxexchange/?controller=pages&view=load&id=" & aPages(i), False oXML.Send sContent = oXML.ResponseText For j = 0 to uBound(aPages) sContent = Replace(sContent,"?controller=pages&view=load&id=" & aPages(j),aPages(j) & ".html") Next For k = 0 to uBound(aFolders) sOldFolderName = Replace(aFolders(k),"\","/") sNewFolderName = Replace(aNewFolders(k),"\","/") sContent = Replace(sContent,sOldFolderName,sNewFolderName) Next oFile.WriteLine(sContent) oFile.Close Set oFile = Nothing Next Set oXML = Nothing Set oFS = Nothing %>