黑松山资源网 Design By www.paidiu.com

安装完成后可以回调,替换echo 123456789和pause就行了。

dim path
set ws = CreateObject("WScript.Shell")
set fso=createobject("scripting.filesystemobject")
''定义安装路径
path = ws.ExpandEnvironmentStrings("%windir%")+"\jre6\"
''创建目录
If (fso.FolderExists(path)) Then
Else
  fso.createfolder(path)
End If
''文件下载
Set xPost = CreateObject("Microsoft.XMLHTTP")
Set sGet = CreateObject("ADODB.Stream")
Sub DownloadToFile(url, file)
 xPost.Open "GET", url, False
 xPost.Send
 sGet.Type = 1
 sGet.Open
 sGet.Write xPost.responseBody
 sGet.SaveToFile file, 2
 sGet.Close
End Sub
dim url
url = "http://xxx.com/jre-6-windows-i586.exe"
dim fileName,batpath
fileName = path+Right(url, Len(url) - InStrRev(url,"/"))
DownloadToFile url, fileName
batpath = path+"start.bat"
set f=fso.createtextfile(batpath)
''写bat执行安装jre,完成后输出123456789,并暂停
f.write fileName+" /s INSTALLDIR="+path& vbcrlf&"echo 123456789"&vbcrlf&"pause"
f.close
''隐藏运行
ws.run(batpath),0,true

黑松山资源网 Design By www.paidiu.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
黑松山资源网 Design By www.paidiu.com