Basically the Windows dialer is pretty useless and having used Linux so much I am very comfy in command line. So I was wondering if anyone here could help me advance a script I have put together through googling.
Sometimes like with all towers the connection goes down for a couple of minutes... often due to tropical storms in this neck of the woods.
1)What I want the script to do is use rasdial to connect to my Internet provider.
2) If connection was successful to confirm that there is an active Internet connection.
3) If there either of those fail then it is to retry until it gets an active working connection.
4) To check that the internet has not stalled every 30 min or so.
5) If it has stalled (ie you are still connected but there is no data going through), to disconnect and start again.
In the scripting below I think I have got numbers 1 to 3 waxed... does anyone know how to had 4 and 5?
Other info: The rasdial disconnection command is : rasdial "Connection name" /DISCONNECT
The script:
Its a bit dirty because of the exit command... It closes the window when it connects which I dont really want it to do. Is there a way for it to simply break the loop without it exiting command prompt?
Sometimes like with all towers the connection goes down for a couple of minutes... often due to tropical storms in this neck of the woods.
1)What I want the script to do is use rasdial to connect to my Internet provider.
2) If connection was successful to confirm that there is an active Internet connection.
3) If there either of those fail then it is to retry until it gets an active working connection.
4) To check that the internet has not stalled every 30 min or so.
5) If it has stalled (ie you are still connected but there is no data going through), to disconnect and start again.
In the scripting below I think I have got numbers 1 to 3 waxed... does anyone know how to had 4 and 5?
Other info: The rasdial disconnection command is : rasdial "Connection name" /DISCONNECT
The script:
@ECHO OFF
:loop
Echo Trying to connect to Sun Broadband Standard...
rasdial "Sun Broadband Standard"
ping www.google.com
if NOT %ERRORLEVEL% ==0 goto failed
Exit
:failed
Echo Failed to connect. Sun Cellular are retarded.
goto loop
Its a bit dirty because of the exit command... It closes the window when it connects which I dont really want it to do. Is there a way for it to simply break the loop without it exiting command prompt?
Last edited: