Friday, June 10, 2011

Batch File to Check Internet Connection

It's useful to create a small batch file that will check your internet connection and restart the computer if there is no connection at the moment. Of course, nobody restricts you to reset the connection parameters or perform any other actions instead of rebooting the computer. You can take the example below and modify it with help of our award-winning batch files editor.
So here is the script to solve the problem described above:
@echo off
ping m-w-c-s.com

if errorlevel 1 shutdown -r -f -t 0
exit
As far as you can see, the way to check the connection is really simple: we just ping Mental Works Computing Software's site and reboot if it is not available. You can use Google or Yahoo! instead if you prefer.

No comments:

Post a Comment

Translate