Question : WScript: Retry on HTTP GET Connection Timeout

Hi there,

The following command line runs the following WScript for monitoring a website.

All is working fine. I need to add a function to the wscript so that when it can't connect for 1 second, it retries to connect 5 times (with the same 1sec timeout.) If after the last try it still can't connect, it will output the following message "ConnectionTimeout" then exit.

Can you help me with this?

COMMAND LINE: cscript Monitor.js>Output.txt

WScript (NAME: Monitor.js):

var request = new ActiveXObject("Msxml2.XMLHTTP");
var notyetready = 1;

notyetready = 0;

var objArgs = WScript.Arguments;
WScript.Echo(objArgs(0)); "GET", objArgs(0) , true );

while( notyetready )
WScript.Sleep( 100 );

Thanks for your help,

Answer : WScript: Retry on HTTP GET Connection Timeout

no problema mate :)
Random Solutions  
programming4us programming4us