1. Home
  2. Windows

How To Set Up Internet Connectivity Alerts On Windows 10

If your internet is acting up, and you need to keep track when you have a connection or not, the simplest way to do it is to keep an eye on the WiFi symbol in the system tray on Windows 10. When you lose internet connectivity, a yellow exclamation mark appears on the WiFi symbol. You can also ping a website. If you can’t keep an eye on the system tray and pinging seems to tedious for you, you can set up audio internet connectivity alerts on Windows 10 with a simple script.

Internet Connectivity Alerts

This script was originally written by Superuser Fabby, and improved on by VMMF. The script requires that you download a free utility called GNU utilities for Win32. Extract it and look inside the following folder for an EXE called Sleep.exe.

UnxUtils\usr\local\wbin

This will be used to add a waiting time between the checks. This EXE should be in the same folder that you save the script to. You don’t need anything else so feel free to delete it.

Open Notepad and paste the following in it. Save it with a CMD extension, and run the file. The sound.vbs file be created by the script so don’t worry about it.

@ECHO OFF

:whileNoInternet

set "host=8.8.8.8"

::check if internet is working

PING -n 1 -w 5000 "%host%" | findstr /r /c:"[0-9] *ms"

if %errorlevel% neq 0 (

::the internet is not working keep cheking until it does
 echo No internet yet %TIME%
 GOTO whileNoInternet
)

echo we gained internet
::the internet is working play internet ON song

@echo off
set "file=InternetON_GOGOGO.mp3"
( echo Set Sound = CreateObject("WMPlayer.OCX.7"^)
 echo Sound.URL = "%file%"
 echo Sound.Controls.play
 echo do while Sound.currentmedia.duration = 0
 echo wscript.sleep 100
 echo loop
 echo wscript.sleep (int(Sound.currentmedia.duration^)+1^)*1000) >sound.vbs
start /min sound.vbs
@ECHO OFF
:whileInternet

sleep.exe 5s

::check if internet is still working

PING -n 1 -w 1000 "%host%" | findstr /r /c:"[0-9] *ms"

if %errorlevel% == 0 (

::the internet is still working keep cheking until it does not
 echo We have internet %TIME%
 GOTO whileInternet
)

:: detect possible internet glitches (do not trust the first failure)
echo internet glitch detected
sleep.exe 10s

PING -n 1 -w 1000 "%host%" | findstr /r /c:"[0-9] *ms"

if %errorlevel% == 0 (

::the internet is still working keep cheking until it does not
 echo We have internet %TIME%
 GOTO whileInternet
)

:: if it failed twice in a row most likely internet is down

echo we lost internet
::the internet is not working anymore, play internet OFF song

@echo off
set "file=InternetHasFallen.mp3"
( echo Set Sound = CreateObject("WMPlayer.OCX.7"^)
 echo Sound.URL = "%file%"
 echo Sound.Controls.play
 echo do while Sound.currentmedia.duration = 0
 echo wscript.sleep 100
 echo loop
 echo wscript.sleep (int(Sound.currentmedia.duration^)+1^)*1000) >sound.vbs
start /min sound.vbs

::start monitoring if it comes back
GOTO whileNoInternet

That’s all you need to do. A command prompt window will remain open, checking the status of your internet connectivity. If it changes, you will hear the Off sound.

Leave a comment