Hello everyone,
I've got a small challenge that I can't seem to figure out. So, perhaps one of you might take a look at it.
Here is the challenge. I have a program that requires an internet connection to work.
If their is an internet connection it opens and the ms script that I prepared earlier works fine.
BUT ...
If their is no internet connection every thing fails to work.
So, I figured I need an ms script that will detect if I have an internet connection first.
if internet connection ms script runs the rest of the script as normal.
if no internet connection it loops every 5 minutes until their is and then runs the rest of the ms script.
I've checked the forum and found the below rasdial posts. Unfortunately I am unable to get the rasdial to work.
Also, I am operating on a windows xp computer with a linksys lan connected to a cable modem. My lan also occasionally uses a wireless aircard through sprint pcs if the cable connection is unavailable.
Already attempted the two below:
---------------------------------------------
http://www.mjtnet.com/forum/viewtopic.p ... connection
which has this script within:
Let>RP_WAIT=1
Run>cmd.exe /c Rasdial >> %TEMP_DIR%\rasdial.txt
ReadFile>%TEMP_DIR%\rasdial.txt,ras
Position>No connections,ras,1,rp
If>rp>0
MessageModal>No Connection
Else
MessageModal>Connected
Endif
DeleteFile>%TEMP_DIR%\rasdial.txt
---------------------------------------------
and
---------------------------------------------
http://www.mjtnet.com/forum/viewtopic.p ... connection
which has this script within:
let>RP_WINDOWMODE=0
DeleteFile>c:\rasdial.txt
Run Program>cmd /c rasdial >c:\rasdial.txt
wait>0.5
Let>k=1
Label>start
ReadLn>c:\rasdial.txt,k,line
If>line=##EOF##,finish
rem Message>line
Let>k=k+1
Goto>start
Label>finish
if>k>3
MessageModal>Connection established
endif
---------------------------------------------
Thank you and make sure you have a fantastic day!
Carl
detecting an internet connection
Moderators: JRL, Dorian (MJT support)
This is crude but it has worked for me from my home for several years. Although I ping my work computer rather than microsoft.
Code: Select all
Let>RP_WAIT=1
Run>cmd /c ping microsoft.com > %TEMP_DIR%InternetConnectTest
ReadFile>%TEMP_DIR%InternetConnectTest,file
DeleteFile>%TEMP_DIR%InternetConnectTest
Separate>file,Reply from,var
If>var_count>1,Connection_Available
MDL>No internet connection available
Goto>EOF
Label>Connection_Available
MDL>Internet connection available
Label>EOF
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
It's not really possible to detect an internet connection:
http://www.ndis.com/faq/QA05040101.htm
But you could just ping a known server and see if you get a response within a certain timeout.
http://www.ndis.com/faq/QA05040101.htm
But you could just ping a known server and see if you get a response within a certain timeout.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Look four posts up.
But bear in mind this will cause some PCs to try to connect. That may not be an issue for you.
But bear in mind this will cause some PCs to try to connect. That may not be an issue for you.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?