Networking Test Tool
Welcome, Guest. Please login or register. Did you miss your activation email?


Pages: [1]
  Print  
Author Topic: Networking Test Tool  (Read 715 times)
Britec
Administrator
Hero Member
*****
Posts: 3496



View Profile
« on: July 19, 2010, 02:14:00 PM »

Networking Test Tool

Here is a basic BAT file for testing your Internet Settings



Here is a list of tools

1 - Test your network
2 - Show your network details
3 - Refresh IP
4 - Clear network cache and ARP tables
5 - Trace the route of packets
6 - Reinstall the TCP/IP protocol
7 - Reset the Winsock API
8 - Exit

Here is the code or you can download BAT file
Download Network Test Tool

Code:
@echo off
TITLE "Network Test Tool"


:start
echo.
echo --------------------------------
echo Welcome to the Network Test Tool
echo --------------------------------
echo.
echo This program works best when it is run from an account
echo with administrative rights.
echo.
echo Please remember to use these commands with:
echo Discretion, knowledge and common sense.
echo.

C:
CD %SystemRoot%\System32 2>nul
CD %SystemRoot%\sysWOW64 2>nul
REM Changes directory into where we need

:menu
echo.
echo 1 - Test your network
echo 2 - Show your network details
echo 3 - Refresh IP
echo 4 - Clear network cache and ARP tables
echo 5 - Trace the route of packets
echo 6 - Reinstall the TCP/IP protocol
echo 7 - Reset the Winsock API
echo 8 - Exit
echo.
SET /P MENU=Selection:
IF {%MENU%}=={1} (goto :test)
IF {%MENU%}=={2} (goto :ip)
IF {%MENU%}=={3} (goto :refresh)
IF {%MENU%}=={4} (goto :cache)
IF {%MENU%}=={5} (goto :trace)
IF {%MENU%}=={6} (goto :tcp)
IF {%MENU%}=={7} (goto :api)
IF {%MENU%}=={8} (goto :exit)

echo.
echo Pease make a proper selection
goto :menu
REM if it has not gone to something, you did it wrong

:test
echo.
echo.
echo Testing basic connectivity.
echo.
ping google.com > %TEMP%\pinglog
REM Changes directory into where we need, and pings Google while tempsaving the output.
find "Reply from" < %TEMP%\pinglog > nul
if not errorlevel 1 echo We can connect to Google.com! This signifies all is good with your connection.
REM Perfect connection :D
find "Request timed out" < %TEMP%\pinglog > nul
if not errorlevel 1 echo Couldn't connect, your connection timed out! I'd recommend you refresh the page and try again!
REM Usually this means is that their server is slow. Usually.
find "Unknown host" < %TEMP%\pinglog > nul
if not errorlevel 1 echo Couldn't connect, unknown host! This means the site is new and we don't know their IP address.
REM Oh noes! You found a new site! That's why DNS and IP won't match up... not for the next little bit at least.
find "could not find host" < %TEMP%\pinglog > nul
if not errorlevel 1 echo Couldn't connect, your connection can't find the host. This means that you're not connected to the internet. Most likely your ISP is down or your wireless card cannot get a clear signal.
REM Connect to the internet or check your cables. Chances are good it's one or the other.
echo.
goto :menu

:ip
echo.
echo.
SET /P DETAIL=Basic or Advanced level of detail (b/a):
echo.
echo Finding network details...
echo.
IF /i {%DETAIL%}=={b} (ipconfig)
IF /i {%DETAIL%}=={a} (ipconfig /all)
echo.
echo Done
echo.
goto :menu
REM Basic diagnostic tool. See your internal IP. Advanced users may want to see DNS or DHCP, subnet mask, proxy, and someothers.

:refresh
echo.
echo.
echo Working...
echo.
ipconfig /release
echo.
ipconfig /renew
echo.
echo Done
echo.
goto :menu
REM IPConfig/release & /renew, oldest tricks in the book to restore a connection. And it works.

:cache
echo.
echo.
echo Working...
echo.
netsh interface ip delete arpcache
ipconfig /flushdns
echo.
echo Done
echo.
goto :menu
REM Kinda funny how this is the second most common issue, eh? Worth a shot!

:trace
echo.
echo.
SET /P ADDRESS=Input address:
echo.
echo Working...
echo.
tracert %ADDRESS%
echo.
echo Done
goto :menu
REM Traceroot, inside your own computer. Most geeks I know don't even realise it!

:tcp
echo.
echo.
echo It is best to have administrative privillages to run this command.
SET /P CONTINUE=Continue (y/n):
IF /i {%CONTINUE%}=={n} (goto :menu)
echo.
echo Reinstalling TCP/IP protocol...
netsh int ip reset %TEMP%\resetlog.txt
echo Done. You must restart your computer for the changes to take full effect
echo.
goto :menu
REM I hate netsh. It requires admin account and everything needs a computer restart. But sometimes it's the only way out

:api
echo.
echo.
echo You NEED to have administrative privillages to run this command.
SET /P CONTINUE=Continue (y/n):
IF /i {%CONTINUE%}=={n} (goto :menu)
echo.
echo Resetting Winsock API...
netsh Winsock reset
echo Done
echo.
goto :menu
REM winsock is the interface programs use to access the TCP/IP stack. Sometimes a layered service provider(LSP) will fit between the winsock and TCP/IP layers. This should fix how winsock deals with that extra LSP

:exit
echo.
echo.
echo Thank you for using the Network Test Tool. Have a good day!
echo.
pause
Logged



tmy
Hero Member
*****
Posts: 673



View Profile WWW
« Reply #1 on: November 02, 2010, 05:01:43 AM »

 Azn Brian,
thanks for this it is a very useful bit of software, your a top man in your field mate thanks for the great work  You Rock

Take care

tmy

 Bye
Logged

www.stannic.com.au  Home Computing Services And Repairs
GraFowler
Newbie
*
Posts: 3


View Profile
« Reply #2 on: February 21, 2011, 07:09:58 AM »

Dear Britec Administrator,
This network testing tool looks very good will it diagnose a faulty network connection and REPAIR this and do I have to re-configure the customers wireless router or after I have used these tools will it done for me , or do you recommend another software application that will diagnose and repair. I don't mind paying for a software application that can diagnose and repair. Have you or your members come across a software application called Spiceworks 5.0, can this do what I need?
 look forwards to your replies.
GraFowler
Logged
Makcalable
Jr. Member
**
Posts: 72


Windows 7 Ultimate X64


View Profile WWW
« Reply #3 on: February 21, 2011, 07:36:00 AM »

This is a great little tool, thanks Britec!  Wink
Logged

Pages: [1]
  Print  
 
Jump to: