Posted in Javascript onMay 06, 2008
//use: cscript this.js http://www.xxx.com/xxx.exe c:\xxx.exe
var objArgs = WScript.Arguments;
var sGet=new ActiveXObject("ADODB.Stream");
var xGet = false;
try {
xGet = new XMLHttpRequest();
}
catch (trymicrosoft) {
try {
xGet = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (othermicrosoft) {
try {
xGet = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (failed) {
xGet = false;
}
}
}
xGet.Open ("GET",objArgs(0).toLowerCase(),0);
xGet.Send();
sGet.Mode=3;
sGet.Type=1;
sGet.Open();
sGet.Write (xGet.ResponseBody);
sGet.SaveToFile (objArgs(1).toLowerCase(),2);
用js实现下载远程文件并保存在本地的脚本
声明:登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。
Reply on: @reply_date@
@reply_contents@