Programming: batch files:Connection Checker

Posted May 12, 2009 by risingdevil / comments 1 comments / Print / Font Size Decrease font size Increase font size

wan't to learn batch programming? Check this one out!

This is a small connection checking tool.

It tests your connection and searches for connection devices.


@echo off
title connection tester
color 0a


ping localhost -n 1 >nul

:menu
cls
set "%c%" == "0"
echo.
echo -----------------------------------------------
echo.
echo          What would you like to do?
echo.
echo       1. Check for connection devices.
echo       2. Check for internet connection.
echo       3. Quit
echo.
echo -----------------------------------------------
set /p c=Your Choise:    

if "%c%" == "1" goto devices
if "%c%" == "2" goto connection
if "%c%" == "3" goto exit
goto menu

:devices
cls
echo Checking for connection devices...
ipconfig
ping localhost -n 2 >nul
cls
if errorlevel 1 goto nodevice
if errorlevel 0 goto yesdevice
cls
echo.
echo Checking status of connection deviced failed...
echo.
ping localhost -n 2 >nul
goto menu

:nodevice
cls
echo.
echo No connection devices found.
echo.
echo press any key to return to menu
pause >nul
goto menu

:yesdevice
cls
echo Connection devices found!
echo.
echo Enter "view" to view devices, or press enter to go back to the menu.
set /p view=    
if "%view%" == "view" goto ipconfiguration
goto menu

:ipconfiguration
cls
echo checking devices...
ping localhost -n 2 >nul
cls
ipconfig
echo.
echo.
echo.
echo press any key to return to menu...
pause >nul
goto menu

:connection
cls
echo.
echo Checking internet connection
ping http://www.google.com >nul
cls
if errorlevel 1 goto nointernet
if errorlevel 2 goto internet
cls
echo Checking connection failed.
echo.
echo returning to menu...
ping localhost -n 2 >nul
cls
goto menu

:nointernet
cls
echo.
echo No connection found.
echo.
echo press any key to return to menu...
pause >nul
cls
goto menu

:internet
cls
echo.
echo Internet connection found!
echo.
echo Press any key to return to menu...
pause >nul
goto menu

:exit
cls
echo -----------------------------------------------
echo.
echo             Made by RisingDevil
echo.
echo -----------------------------------------------
cls

Designed and Created By RisingDevil.

Also check my youtube channel : http://www.youtube.com/arturconfituur or click here (will open in new window)

Rate this Article:

Be the first to rate me.

  • Nothing Found!

    Why not submit your own content? Signup here.


* You must be logged in order to leave comments, please login or join us.

Comments

KingKong
KingKong said... on May 12th, 2009 at 8:49 PM

Another one! You are good, keep it up. : )



Bookmark and Share
Sign up for our email newsletter
Name:
Email: