After the installation is complete, you can callback, replacing Echo 123456789 and pause.
Dim path
Set ws = CreateObject ("Wscript.Shell")
set Fso=createobject ("Scripting.FileSystemObject")
" Define installation path Path
= ws. ExpandEnvironmentStrings ("%windir%") + "\jre6\" "
Create directory
If (FSO). FolderExists (path)) Then
Else
fso.createfolder (path) end
If
' file downloads
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)
' Write bat performs the install JRE, outputs 123456789 after completion, and pauses
f.write filename+ "/s installdir=" +path & vbcrlf& "echo 123456789" &vbcrlf& "pause"
f.close "
Hide Run
ws.run (batpath), 0,true