Set args = WScript.Arguments Dim scriptFolder, softwareName, kickstartInstallationId, securityKey, updateKickstartInstallationUrl, percentComplete scriptFolder = "C:\Windows\Setup\" ' Make sure we have a software name If args.Count >= 1 Then softwareName = args(0) Else WScript.Echo "Missing software name (plesk)" WScript.Quit End If ' Check for postback variables If args.Count >= 5 Then kickstartInstallationId = args(1) securityKey = args(2) updateKickstartInstallationUrl = args(3) percentComplete = args(4) End If ' Download Objects Set oX = CreateObject("Microsoft.XmlHTTP") Set fso = CreateObject("Scripting.FileSystemObject") ' If we have the arguments, update the installation If Len(percentComplete) Then WScript.Echo "kickstartInstallationId:" + kickstartInstallationId WScript.Echo "securityKey:" + securityKey WScript.Echo "updateKickstartInstallationUrl:" + updateKickstartInstallationUrl WScript.Echo "percentComplete:" + percentComplete Set oX = CreateObject("MSXML2.ServerXMLHTTP.3.0") Dim statusUrl statusUrl = updateKickstartInstallationUrl & "?kickstartInstallationId=" & kickstartInstallationId statusUrl = statusUrl & "&securityKey=" & securityKey & "&percentComplete=" & percentComplete statusUrl = statusUrl & "&message=Installing%20" & softwareName WScript.Echo statusUrl oX.Open "GET", statusUrl, False oX.Send WScript.Echo oX.responseText & vbCRLF End If ' Select what software If softwareName = "plesk" Then ' Download the plesk auto installer oX.Open "GET", "http://192.168.200.2/software/windows/plesk/ai.exe", False oX.Send Set oStream = CreateObject("Adodb.Stream") ' With defines a scope. Automatically closes on 'End With' With oStream .type = 1 ' Binary .open .write oX.responseBody .savetofile scriptFolder + "ai.exe", 2 ' Overwrite End With ' Run the installation Set objShell = CreateObject("WScript.Shell") Return = objShell.Run(scriptFolder + "ai.exe --console --select-product-id=panel --select-release-latest --installation-type=recommended", 1, True) 'Return = objShell.Run(scriptFolder + "ai.exe --console --select-product-id=panel --select-release-latest --installation-type=typical", 1, True) 'Return = objShell.Run(scriptFolder + "ai.exe --console --select-product-id panel --select-release-id PANEL_11_5_30_WIN --install-component common --install-component panel", 1, True) 'Return = objShell.Run(scriptFolder + "ai.exe --console --select-product-id panel --select-release-id PANEL_11_5_30_WIN --install-component base --install-component management --set-option ""PLESK_INSTALLDIR=C:\Plesk Dir"" --set-option ""PLESK_DATADIR=C:\Plesk Data"" --set-option ""PLESK_VHOSTSDIR=C:\Plesk Vhosts""", 1, True) 'Return = objShell.Run(scriptFolder + "ai.exe --console --select-product-id panel --select-release-id PANEL_11_5_30_WIN --install-component base --install-component management --install-component spamassassin --install-component webalizer --install-component drweb --set-option ""PLESK_INSTALLDIR=C:\Plesk Dir"" --set-option ""PLESK_DATADIR=C:\Plesk Data"" --set-option ""PLESK_VHOSTSDIR=C:\Plesk Vhosts""", 1, True) ' ai.exe --show-all-releases ' ai.exe ' Remove the executable If fso.FileExists(scriptFolder + "ai.exe") Then WScript.Echo "Removing executable ai.exe" fso.DeleteFile(scriptFolder + "ai.exe") End If End If