With the release of GFIMax agent V8.5 i wanted to test it, but don’t have the time to log on and install. So i made a script.
Download the agent agent_8_5_0.exe Save it 2 your web server, edit the script, save as VBS, away you go.
Just make a task in GFI to call the script, then away it goes. Or you can just run the script manualy.
———–
sTarget = “C:temp”
Set objFSO = CreateObject(“Scripting.FileSystemObject”)
If Not objFSO.FolderExists(sTarget) Then
objFSO.CreateFolder(“c:temp”)
End If
strFileURL = “http://www.YOURSERVER/AGENT_8_5_0.EXE”
strHDLocation = “c:tempAGENT_8_5_0.EXE”Set objXMLHTTP = CreateObject(“MSXML2.XMLHTTP”)
objXMLHTTP.open “GET”, strFileURL, false
objXMLHTTP.send()
If objXMLHTTP.Status = 200 ThenWscript.Echo “Downloading the latest version of Agent…” & VbCrLf & VbCrLf
Set objADOStream = CreateObject(“ADODB.Stream”)
objADOStream.Open
objADOStream.Type = 1 ‘adTypeBinary
objADOStream.Write objXMLHTTP.ResponseBody
objADOStream.Position = 0
Set objFSO = Createobject(“Scripting.FileSystemObject”)
If objFSO.Fileexists(strHDLocation) Then objFSO.DeleteFile strHDLocation
Set objFSO = Nothing
objADOStream.SaveToFile strHDLocation
objADOStream.Close
Wscript.Echo “Download complete” & VbCrLf & VbCrLf
Set objADOStream = Nothing
End if
Set WshShell = WScript.CreateObject(“WScript.Shell”)
Return = WshShell.Run(“c:tempAGENT_8_5_0.EXE /silent “, 0, true)
—————
« Script to Extract files from ZIP and cleanup Script to check Exchange Server 2007 Version »
This is cool. I”ve tried it and run into a couple of “issues” that I overcame by passing through a command-line argument for the download location and saving it simply as “AGENT.EXE” … I could have made it a little more elegant, but I”m not a very good writer.
Still awaiting the run, but wanted to post a reply before I had to head out of the office for the evening. Check on the Forum for further replies…
Todd Haugland, GFIMAX Sales Engineer