This shows you the differences between two versions of the page.
— |
wiki:windows:batch:ping_tester [2016/06/29 18:55] (current) matt created |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Ping Tester ====== | ||
+ | This is an anonymized version of a remote printer ping tester I (Matt S.) made. It allows you to select which location to test and will test the VPN router and printer IP addresses and return a plain English answer if the connections are up or down. | ||
+ | ===== Batch File Code ===== | ||
+ | <code> | ||
+ | @echo off | ||
+ | |||
+ | title VPN Ping Test | ||
+ | |||
+ | :start | ||
+ | cls | ||
+ | echo Which location do you want to test? | ||
+ | echo ___________________________________ | ||
+ | echo 1. Location1 | ||
+ | echo 2. Location2 | ||
+ | echo 3. EXIT | ||
+ | echo ... | ||
+ | |||
+ | set /p choice="Enter a number and press ENTER:" | ||
+ | if "%choice%"=="1" goto test-location1 | ||
+ | if "%choice%"=="2" goto test-location2 | ||
+ | if "%choice%"=="3" exit | ||
+ | echo Invalid choice: %choice% | ||
+ | echo . | ||
+ | pause | ||
+ | cls | ||
+ | goto start | ||
+ | |||
+ | :test-location1 | ||
+ | echo Checking Location1... | ||
+ | ping -n 1 192.168.20.10 >nul | ||
+ | if errorlevel 1 ( | ||
+ | cls | ||
+ | echo Location1 VPN is DOWN! | ||
+ | echo Hit ENTER to test another conection. | ||
+ | pause>nul | ||
+ | goto start | ||
+ | ) | ||
+ | |||
+ | cls | ||
+ | echo Location1 VPN is UP | ||
+ | ping -n 1 192.168.20.20 >nul | ||
+ | if errorlevel 1 ( | ||
+ | echo Location1 PRINTER is DOWN! | ||
+ | echo Hit ENTER to test another conection. | ||
+ | pause>nul | ||
+ | goto start | ||
+ | ) | ||
+ | echo Location1 PRINTER is UP | ||
+ | echo Hit ENTER to test another conection. | ||
+ | pause>nul | ||
+ | goto start | ||
+ | |||
+ | |||
+ | :test-location2 | ||
+ | echo Checking Location2... | ||
+ | ping -n 1 192.168.30.10 >nul | ||
+ | if errorlevel 1 ( | ||
+ | cls | ||
+ | echo Location2 VPN is DOWN! | ||
+ | echo Hit ENTER to test another conection. | ||
+ | pause>nul | ||
+ | goto start | ||
+ | ) | ||
+ | |||
+ | cls | ||
+ | echo Location2 VPN is UP | ||
+ | ping -n 1 192.168.30.20 >nul | ||
+ | if errorlevel 1 ( | ||
+ | echo Location2 PRINTER is DOWN! | ||
+ | echo Hit ENTER to test another conection. | ||
+ | pause>nul | ||
+ | goto start | ||
+ | ) | ||
+ | echo Location2 PRINTER is UP | ||
+ | echo Hit ENTER to test another conection. | ||
+ | pause>nul | ||
+ | goto start | ||
+ | </code> |