| First make a copy of your mirror, unless you don't mind downloading it all
again :)
Save the following to a file called Rewrite-AdTech.vbs
const ForReading = 1, ForWriting = 2
dim fso, f, daHTML, filespec, outfile
' get the filename from the command line...
filespec = WScript.Arguments.item(0)
' now take the input file and read it into a variable the close the file...
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile(filespec, ForReading)
daHTML = f.ReadAll
f.Close()
' now take the HTML and replace all the adtech urls...
daHTML = Replace(daHTML, <http://adserver.adtech.de>, "")
' now open the same file for output to place all the changes into...
Set outfile = fso.CreateTextFile(filespec, True)
' write out the new file and close it up...
outfile.write(daHTML)
outfile.Close()
' close all the object handles...
Set f = Nothing
Set fso = Nothing
Set outfile = Nothing
'msgbox "All Done",,"VBScript"
--------------------------------
Then go to the top level folder where your mirror is.
Open a DOS box.
Type:
for /R . %a in (*.htm,*.html) do P:\VBS\Rewrite-AdTech.vbs %a
Change the P:\VBS\ to which ever folder you saved the .vbs file to.
This will loop thru all the folders/subfolders in that mirror and send each
.htm or .html file to the .vbs script and replace the contents of each,
removing the <http://adtech> with nothing.
Then try opening your local files, see if it works.
> | |