|
脚本实现文件下载,这个是jscript的,脚本之家以前曾发布vbscript版本的,原理一样的。
jscript版本 复制代码 代码如下: var objArgs=WScript.Arguments; var sGet=new ActiveXObject("ADODB.Stream"); var xGet=null; try{ xGet=new XMLHttpRequest(); }catch(e){ try{ xGet=new ActiveXObject("Msxml2.XMLHTTP"); }catch(ex){ try{ xGet=new ActiveXObject("Microsoft.XMLHTTP"); }catch(e3){ xGet=null; } } } if(xGet != null){ xGet.Open("GET","http://localhost/aplan/mycalc.exe",0); xGet.Send(); sGet.Mode=3; sGet.Type=1; sGet.Open(); sGet.Write(xGet.ResponseBody); sGet.SaveToFile("D:\\haha.exe",2); }
vbscript版本的请查看这篇文章。 |
|