Using a batch file would it be possible to do something like:
ping google.com
if return success do ECHO You are connected to the internet
else return
@echo off :loop ping www.google.com -n 1 -w 5000 >NUL if errorlevel 1 echo Not connected goto Loop