Windows Network Troubleshooting Script
I try my best to stay away from Windows. I wish my clients did the same. The usual difficulty of troubleshooting elusive network performance problems is amplified many-fold when there is a Windows computer at the end of the line. With Unix it’s relatively simple: run tests “a”, “b”, “c”, etc and follow the familiar process of elimination. With Windows in the picture the number of steps uses up all of the English alphabet and spills over well into the Russian one. And when you finally reach step “я”, you have to pull out your Chinese dictionary.
Below is a simple but, as I found time and time again over the past few years, and extremely useful little batch script that collects important network performance information on the affected Windows system. The script does not require admin privileges and doesn’t make any changes to the system. Any Windows user can run it and send you the output. The information the script collects would help you quickly catch many common Windows networking issues.
Download netprobe.zip
@Echo OFF
for /f "tokens=1,2" %%u in ('date /t') do set d=%%v
for /f "tokens=1" %%u in ('time /t') do set t=%%u
if "%t:~1,1%"==":" set t=0%t%
set timestr=%d:~6,4%%d:~3,2%%d:~0,2%%t:~0,2%%t:~3,2%
set OUTFILE=C:\User\netprobe_%timestr%.txt
echo --------------------------------------------------------- > %OUTFILE%
echo Email contents of this file to your_email@whatever.com >> %OUTFILE%
echo --------------------------------------------------------- >> %OUTFILE%
hostname >> %OUTFILE%
echo %USERDOMAIN%\%USERNAME% >> %OUTFILE%
date /T >> %OUTFILE%
time /T >> %OUTFILE%
echo --------------------------------------------------------- >> %OUTFILE%
echo IPCONFIG >> %OUTFILE%
echo --------------------------------------------------------- >> %OUTFILE%
ipconfig /All >> %OUTFILE%
echo --------------------------------------------------------- >> %OUTFILE%
echo --------------------------------------------------------- >> %OUTFILE%
echo PING >> %OUTFILE%
echo --------------------------------------------------------- >> %OUTFILE%
set TARGET=hostname_or_ip_of_target_server
ping -w 1000 -n 10 -l 512 %TARGET% >> %OUTFILE%
echo --------------------------------------------------------- >> %OUTFILE%
echo --------------------------------------------------------- >> %OUTFILE%
echo TRACERT >> %OUTFILE%
echo --------------------------------------------------------- >> %OUTFILE%
tracert -w 512 %TARGET% >> %OUTFILE%
echo --------------------------------------------------------- >> %OUTFILE%
echo --------------------------------------------------------- >> %OUTFILE%
echo NETSTAT >> %OUTFILE%
echo --------------------------------------------------------- >> %OUTFILE%
netstat -a >> %OUTFILE%
echo --------------------------------------------------------- >> %OUTFILE%
netstat -e >> %OUTFILE%
echo --------------------------------------------------------- >> %OUTFILE%
netstat -p TCP >> %OUTFILE%
echo --------------------------------------------------------- >> %OUTFILE%
netstat -p UDP >> %OUTFILE%
echo --------------------------------------------------------- >> %OUTFILE%
netstat -p IP >> %OUTFILE%
echo --------------------------------------------------------- >> %OUTFILE%
netstat -r >> %OUTFILE%
echo --------------------------------------------------------- >> %OUTFILE%
netstat -s >> %OUTFILE%
echo --------------------------------------------------------- >> %OUTFILE%
notepad %OUTFILE%
del %OUTFILE%Popularity: 1% [?]





Hello………
thanx That vary nice script. check it on my pc after making some change.