Network testing batch file

Open notepad.exe and paste the following:

@echo off
TITLE “Network Test Tool”
CD %SystemRoot%\System32 2>nul
CD %SystemRoot%\sysWOW64 2>nul
echo Testing basic connectivity.
ping > %TEMP%\pinglog
REM Changes directory into where we need, and pings Google while tempsaving the output.
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 “Reply from” < %TEMP%\pinglog > nul
if not errorlevel 1 echo We can connect to! 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 “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 Do you want to refresh your connection?
SET /P ANSWER=This might help you connect to the internet if you’re having problems.(Y/N)
if /i {%ANSWER%}=={y} (goto :yes)
if /i {%ANSWER%}=={yes} (goto :yes)
goto :no
ipconfig /release
ipconfig /renew
REM IPConfig/release & /renew, oldest tricks in the book to restore a connection. And it works.
echo Would you like to clear your network connection’s cache?
SET /P ANSWER2=This gets corrupted once in a while, making it impossible to connect. (Y/N)
if /i {%ANSWER2%}=={y} (goto :yes)
if /i {%ANSWER2%}=={yes} (goto :yes)
goto :no
netsh interface ip delete arpcache
ipconfig /flushdns
REM Kinda funny how this is the second most common issue, eh? Worth a shot!
SET /P ANSWER3=Would you like to do a traceroute? (Y/N)
if /i {%ANSWER3%}=={y} (goto :yes)
if /i {%ANSWER3%}=={yes} (goto :yes)
goto :no
SET /P ANSWER4=Input address:
tracert %ANSWER4%
REM Traceroot, inside your own computer. Most geeks I know don’t even realise it!
echo Thank you for using the Network Test Tool. Have a good day!
REM It’s no hard program, and if you need/want the source code, just open this sucker in a notepad program.
REM I used Notepad++… add on if you wish, but don’t delete my comments and email me what you changed.

Save as networktest.bat and run.

Source: Unknown


Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s