通过wscript运行的JS脚本,如何引入另一个JS文件

链接:

https://helloacm.com/include-external-files-in-vbscriptjscript-wsh/

 

代码示例:

function Include(jsFile) 
{
    var fso, f, s;
    fso = new ActiveXObject("Scripting.FileSystemObject"); 
    f = fso.OpenTextFile(jsFile); 
    s = f.ReadAll(); 
    f.Close(); 
    return(s); 
}

eval(Include("File.js"));

 

posted @ 2019-11-05 16:57  飞鹰007  阅读(134)  评论(0编辑  收藏