Ping Connection Test with Sound

Posted: February 8, 2011 in CLI, Linux, Windows

Hello Guys,

I just finished a draft for a Ping Connection Test that emits a sound when its Disconnected, I like this to monitor my internet even if I am not using it, also more actions can be done not just the sound, this is just a start, this is the first draft of the code, I will be posting a step by step details later.

@echo off
:A
set destination=%1
ping %destination% -n 1 |FIND /C “TTL” > c:/temp.log
set /p result=< c:/temp.log
IF %result% EQU 0 (
echo “Connection Inactive”
type beep.txt
ping 0.0.0.0 -w 1000 > NUL
GOTO A
)
IF %result% EQU 1 (
echo “Connection Active”
ping 0.0.0.0 -w 100000 > NUL
)
GOTO A

As I said this is just a basic draft later on I will post how to create you own and how to run it.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s