Create a Windows Batch (.bat) File to Test Your Internet Connectivity

I have been having issues with my ISP‘s WiFi router, so I decided to create a batch file I could run as-needed to check internet connectivity.

@echo off
cls
set "router=192.168.0.1"
set /p "router=Enter router IP address or press [ENTER] for default [%router%]: "
@ping %router% -n 1 | FIND "Reply"
@ping google.com -n 1 | FIND "Reply"
@ping bing.com -n 1 | FIND "Reply"
echo Press any key to exit...
pause >nul

Save that as `ping.bat` and put in somewhere convenient. Then…

If you want to pin the command to your Windows start menu or taskbar, follow these instructions…

  1. Right-click inside a folder or your Desktop and select:
    New > Shortcut
  2. Enter the following in the “location” field:
    cmd /c “C:\path\to\your\ping.bat”
  3. Give the shortcut a meaningful name, I used:
    Check Internet Connection
  4. Right-click and pin to your start menu or taskbar.

Leave a Reply

Your email address will not be published. Required fields are marked *