rem ******************************************************************************************* rem *** This runs the start terminal command if the reply from pinging the server fails *** rem ******************************************************************************************* ::ping the server IP once for the first time ping xx.xxx.xxx.xxx -n 1 ::if the ping passed goto the end IF %errorlevel% == 0 GOTO END ::if the error returned is 1 then the ping failed ::Wait 1 min ping localhost -n 60 ::------------------------------------------------------------------------------- ::ping the server IP once for the second time ping xx.xxx.xxx.xxx -n 1 ::if the ping passed goto the end IF %errorlevel% == 0 GOTO END ::if the error returned is 1 then the ping failed ::Wait 1 min ping localhost -n 60 ::------------------------------------------------------------------------------- ::ping the server IP once for the third time ping xx.xxx.xxx.xxx -n 1 ::if the ping passed goto the end IF %errorlevel% == 0 GOTO END ::if the error returned is 1 then the ping failed and then start the terminals start "1" "C:\Program Files\MetaTrader - Alpari UK\terminal.exe" start "2" "C:\Program Files\MetaTrader - Alpari UK(2)\terminal.exe" :END