站长资源脚本专栏
下载文件到本地运行的vbs
简介复制代码 代码如下:'on error resume next dl = https://www.jb51.net/index.htm '这是要下载的文件的路径str="Microsoft.XMLHTTP" Set x = CreateObject(str) Set x = CreateObject
复制代码 代码如下:
'on error resume next
dl = https://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
'on error resume next
dl = https://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
上一篇:从一个VBS脚本学习一点点东西
下一篇:15分钟提醒一次,珍惜时间啊