Hello MDL'ers Got something I need help with, I want to download the "default" file from https://download.geogebra.org/package/win-autoupdate The url will start the download automatically when opened in a browser. I want this done in a script so that when run it will download the newest file (well the one it downloads when opened in browser), save it to set location and renamed to xxxxx.exe Anyone got tips/tricks? Best, Bjørn
or the True Scripting Way (vbscript) - saw this a few years ago went straight into my "coolscripts" folder Code: Function HTTPDownload(AURL, ADest) Dim Buffer Dim ADODB ' Assume failure HTTPDownload = FALSE ' Create the ADM stream and HTTP request. Set ADODB = CreateObject("ADODB.Stream") Set Buffer = CreateObject("MSXML2.XMLHTTP") Buffer.Open "GET", AURL, FALSE On Error Resume Next Buffer.Send EMPTY On Error GoTo 0 ' Check that the request is completed (ReadyState is 4). If it isn't, warn. If Buffer.ReadyState = 4 Then WScript.Echo "Status:", Buffer.Status, AURL Else WScript.Echo "Ready State <> 4: ", AURL End If ' If the status is 200 (found), save the body to the destination. Easy. If Buffer.Status = 200 Then If Not (ADODB.State = 0) Then _ ADODB.Close ADODB.Type = 1 ' 1 is binary, 2 is text) ADODB.Mode = 3 ' 1 is read, 2 is write - ORed. ADODB.Open ADODB.Write Buffer.ResponseBody ADODB.SaveToFile ADest, 2 ADODB.Close HTTPDownload = TRUE End If End Function