А вот эта функция?:
function include (filename_this, filename_that) {
function getFso() {
if ( !this.fso ) {
fso = new ActiveXObject("Scripting.FileSystemObject");
}
return fso;
}
function readFromFile(filename) {
if ( !this.fso ) fso = new ActiveXObject("Scripting.FileSystemObject");
var fh = fso.OpenTextFile(filename, 1, true);
var s = "";
if ( !fh.AtEndOfStream ) {
s = fh.ReadAll();
}
fh.Close();
return s;
}
function saveToFile(filename, text) {
if ( !this.fso ) fso = new ActiveXObject("Scripting.FileSystemObject");
var fh = fso.OpenTextFile(filename, 2, true);
fh.Write(text);
fh.Close();
}
if (readFromFile(".include_file") == "1") return;
var this_code = readFromFile(filename_this);
var that_code = readFromFile(filename_that);
saveToFile(".include_file", "1");
saveToFile(filename_this, that_code + "\n" + this_code);
eval(readFromFile(filename_this));
saveToFile(filename_this, this_code);
getFso().DeleteFile(".include_file");
WScript.quit(1);
}