Tekforums

Chat => Guides & Projects => Topic started by: Pete on May 25, 2011, 20:55:30 PM

Title: Pingtest.bat
Post by: Pete on May 25, 2011, 20:55:30 PM
This one is for when you get someone saying their connection drops for a couple seconds every now and then, where your options are:

1) Sit trying to fix it while it's not broken.
2) Put this on their desktop and get them to run it when they think they've been disco'd.

Code: [Select]
echo off
cls
echo hang on a mo...
REM Check localhost
ping localhost -4 -n 1 > c:\ping\pingtest.txt
echo. >> c:\ping\pingtest.txt
echo. >> c:\ping\pingtest.txt

REM Check Default Gateway
ping 192.168.1.253 >> c:\ping\pingtest.txt
echo. >> c:\ping\pingtest.txt
echo. >> c:\ping\pingtest.txt

REM check File Server
ping 192.168.1.10 -n 1 >> c:\ping\pingtest.txt
echo. >> c:\ping\pingtest.txt
echo. >> c:\ping\pingtest.txt

REM Check Internet ping
ping 4.2.2.2 -n 1 >> c:\ping\pingtest.txt
echo. >> c:\ping\pingtest.txt
echo. >> c:\ping\pingtest.txt

REM check dns name resolution
echo NSLOOKUP >> c:\ping\pingtest.txt
nslookup www.tekheads.co.uk >> c:\ping\pingtest.txt
echo. >> c:\ping\pingtest.txt
echo. >> c:\ping\pingtest.txt

REM print ipconfig
ipconfig /all >> c:\ping\pingtest.txt
echo. >> c:\ping\pingtest.txt
echo. >> c:\ping\pingtest.txt

pause

Simple, but dead handy.