JScript replaceInFile
function replaceInFile( filename , searchForRx , replaceWith )
{
filename = FormatArguments(filename , arguments);
if(typeof (searchForRx) == "string")
searchForRx = FormatArguments(searchForRx , arguments);
replaceWith = FormatArguments( replaceWith , arguments );
var text = ReadAll(filename);
// if(!searchForRx.exec(text) )
text = text.replace(searchForRx,replaceWith);
WriteAll(filename, text);
}