I previously used a basic dos bat script which performed a ping to check if an internet connection is available or not. Now, I can no longer ping a server outside of our office network as it has been identified as a security threat. Now I would need a different manner to determine if an internet connection is available. I was thinking to do this with a small vbscript.
I will start the vbs script out of dos with the following command:
START /WAIT "CHECKNET.vbs"
I would need the vbs script to:
1) Check if smtp.google.com can be successfully reached
2) Send "1" if yes, and "0" if not, to C:\IResult.txt
3) Close vbs
I can then use that .txt file and check the value inside it with a dos bat script. I need the vbs script to be as simple as possible. It must just set a 0 or 1 in the txt file. Nothing is required to be displayed on screen. It would be good if a timeout can be set for how long it tries to find a connection.
Any help with this will be greatly appreciated.