Search

Test If Internet Is Available Using Batch File

* Copy past the following code on to notepad and save it as net.bat

@echo off
set net="www.google.com"
echo "Checking Internet Connection..."
echo "please wait......"
ping -n 1 %net%>nul
if errorlevel 1 (
   cls
   color 10
   echo "NO INTERNET"
echo ".................................................__________......"
echo ".... _________________________________________ ./           \\___"
echo ".___/             /..|        /_/   _____   |_ |   _______   ||.."
echo ".__/ ____       //...|   ____/  |  |.....| ||..|  /...||...\ ||.."
echo "../_____/      //....|   || ....|  |_____| ||..|   ___||___  ||.."
echo "......./      //.....|   |____..|       ___||..|  |___  ___| ||.."
echo "....../      //......|    ___/..|   |\   \\ ...|   ...||...  ||.."
echo "...../      //.......|   || ....|   |.\   \\ ..|   ...||...  ||.."
echo "..../      //_______ |   |______|_  |..\   \\ .|  \___||___/ ||.."
echo ".../  ____________ /_|           /  |__.\   \\ |             ||.."
echo "__/_______________/.\___________/_____/..\___\\\____________//..."
   pause
) ELSE (
   cls
   color A
   echo "INTERNET IS CONNECTED"
echo "I.........................................."
echo "N.........................................."
echo "T.........................................."
echo "E.........................................."
echo "R.........................................."
echo "N.........................................."
echo "E.........................................."
echo "T.........................................."
   pause
)

No comments:

Post a Comment

Popular Posts

Latest Posts

Blog Archive