时间:2014-6-16 作者:admin 分类: 摘自网络
linux很方便可以直接wget,windows用vbs下载挺方便的。随便在网上找了个小脚本改了下就ok了。
命令行下执行参数url:cscript 1.vbs /url:http://www.baidu.com/img/bdlogo.gif
'执行后下载到当前目录:cscript 1.vbs /url:http://www.baidu.com/img/bdlogo.gif Set xPost = CreateObject("Microsoft.XMLHTTP") Set sGet = CreateObject("ADODB.Stream") Sub DownloadToFile(url, file) xPost.Open "GET", url, False xPost.Send sGet.Type = 1 sGet.Open sGet.Write xPost.responseBody sGet.SaveToFile file, 2 sGet.Close End Sub dim url url = WScript.Arguments.Named.Item("url") dim fileName fileName = Right(url, Len(url) - InStrRev(url,"/")) DownloadToFile url, fileName
摘自 园长MM http://p2j.cn/?p=1339