New
#1
BAT file for Initial Diagnosis of Network Problems
I have updated this Post to make it easier for members to link to when helping others.
The Batch Script is intended to be used for 'Network Diagnostics' [ or general informational purposes ]. This is only an initial step in the diagnostics process, and will allow us to rule out potential causes and problems.
Simply download and run the following Batch file [ it will take a minute or two ].
A special thanks to @MaloK for his input and contributions.
UPDATED: 13-Sep-2022.
Download
If you would rather create your OWN Batch file, here is the code . . .
Code:@echo off Title Basic Network Diagnostics Information & mode con: cols=71 lines=16 set "LOG=Basic_Network_Diagnostics_Information.log" set "TFN=%Temp%\%LOG%" if exist %TFN% (del /f /q %TFN% >nul 2>&1) echo. & echo Processing [ Collecting Basic Network Diagnostics Information ] . . . echo. & echo ---------------------------------------------------------------------&>> %TFN% echo. >> %TFN% echo ########################################################################################## >> %TFN% echo # Title : Basic Network Diagnostics Information # >> %TFN% echo # Created By: https://www.tenforums.com/members/paul-black.html # >> %TFN% echo # : https://www.tenforums.com/members/malok.html # >> %TFN% echo # Created On: 13-Sep-2022 # >> %TFN% echo ########################################################################################## >> %TFN% ver &>> %TFN% echo. >> %TFN% echo Started: %Date% at %Time% &>> %TFN% echo. >> %TFN% echo ========================================= START ========================================== echo Getting Network Information . . . >> %TFN% echo Network Adapter[s] Status: >> %TFN% echo ========================================================================================== >> %TFN% netsh interface show interface >> %TFN% netsh interface ip show interfaces >> %TFN% netsh mbn show interfaces >> %TFN% echo ========================================================================================== >> %TFN% echo IP Configuration FULL [ ipconfig /all ]: >> %TFN% echo ========================================================================================== >> %TFN% ipconfig /all &>> %TFN% echo. >> %TFN% echo ========================================================================================== >> %TFN% echo Routing Table: >> %TFN% echo ==========================================================================================&>> %TFN% echo. >> %TFN% netstat -r &>> %TFN% echo. >> %TFN% echo ========================================================================================== echo Running Ping . . . >> %TFN% echo Ping Loopback Adapter [ THIS Computer ]: >> %TFN% echo ========================================================================================== >> %TFN% ping 127.0.0.1 &>> %TFN% echo. >> %TFN% echo ========================================================================================== >> %TFN% echo Ping 8.8.4.4 [ dns.Google.com ]: >> %TFN% echo ========================================================================================== >> %TFN% ping 8.8.4.4 &>> %TFN% echo. >> %TFN% echo ========================================================================================== >> %TFN% echo Ping dns.Google.com: >> %TFN% echo ========================================================================================== >> %TFN% ping dns.google.com &>> %TFN% echo. >> %TFN% echo ========================================================================================== echo Running NSLookup . . . >> %TFN% echo NSLookup 8.8.4.4 [ dns.Google.com ]: >> %TFN% echo ==========================================================================================&>> %TFN% echo. >> %TFN% nslookup 8.8.4.4 2>nul >> %TFN% echo ========================================================================================== >> %TFN% echo NSLookup dns.Google.com: >> %TFN% echo ==========================================================================================&>> %TFN% echo. >> %TFN% nslookup dns.google.com 2>nul >> %TFN% echo ========================================================================================== echo Running TraceRT . . . >> %TFN% echo TraceRT 8.8.4.4 [ dns.Google.com ]: >> %TFN% echo ========================================================================================== >> %TFN% tracert 8.8.4.4 &>> %TFN% echo. >> %TFN% echo ========================================================================================== >> %TFN% echo TraceRT dns.Google.com: >> %TFN% echo ========================================================================================== >> %TFN% tracert dns.google.com &>> %TFN% echo. >> %TFN% echo ========================================== EOF ===========================================&>> %TFN% echo. >> %TFN% echo Completed: %Date% at %Time% echo. & echo --------------------------------------------------------------------- echo. & echo Processing Complete. start Notepad %TFN% & timeout /t 3 /nobreak >nul & del %TFN% echo. & echo ^>Press ANY key to EXIT . . . & pause >nul & Exit
Once the program has finished running, the results will open inNotepad
.
Please perform one of the following . . .
Save
the file and thenUpload
it [ preferred method ] . . .
How to Upload and Post Screenshots and Files at Ten Forums
Copy & Paste
the contents into a Post.
I am sure that someone will be able to give you advice and help.
NoteThe following is the ORIGINAL start of this post for continuity . . .
Good afternoon,
We often ask for members to initially runipconfig /all
and Post the results.
To get some additional information that might prove to be helpful at the same time that they runipconfig /all
, I wrote the following Batch Script which I use. Is there ANY reason that the results output shouldNOT
be posted because of sensitive information etc . . .
Code:@echo off :: ##################################################### :: # Title : Basic Network Diagnostics Information # :: # Created By: Paul Black # :: # Created On: 05-Feb-2022 # :: ##################################################### set "OUT=%Temp%\OUT.log" if exist %OUT% (del /f /q %OUT% >nul 2>&1) echo. & echo ^>Network Adapter[s] Status . . . echo. & >> %OUT% PowerShell "Get-NetAdapter -Name * | Select Name, InterfaceDescription, Status, MacAddress | Format-Table -AutoSize | Out-String -Width 1000" 2>&1 findstr /rc:"[^ <Tab>]" %OUT% & del %OUT% echo. & echo ^>IP Configuration Summary . . . echo. & >> %OUT% PowerShell "Get-wmiObject Win32_NetworkAdapterConfiguration -Filter IPEnabled=True | Select @{L='DNS Domain Suffix';E={$_.dnsdomain}}, Description, @{L='MAC [ Physical ] Address';E={$_.macaddress}}, @{L='IP Address';E={$_.ipaddress[0]}}, @{L='Subnet Mask';E={$_.ipsubnet[0]}}, @{L='Default Gateway';E={$_.defaultipgateway[0]}}, @{L='DHCP Enabled';E={$_.dhcpenabled}}, @{L='DHCP Server';E={$_.dhcpserver}} | Out-String -Width 1000" 2>&1 findstr /rc:"[^ <Tab>]" %OUT% & del %OUT% echo. & echo ^>IP Configuration FULL [ ipconfig /all ] . . . ipconfig /all echo. & echo ^>Ping THIS Computer . . . ping 127.0.0.1 echo. & echo ^>Ping www.Google.com . . . ping www.google.com echo. & echo ^>Ping 8.8.8.8 [ www.Google.com ] . . . ping 8.8.8.8 echo. & echo ^>TraceRT www.Google.com . . . tracert www.google.com echo. & echo ^>TraceRT 8.8.8.8 [ www.Google.com ] . . . tracert 8.8.8.8 echo. & echo ^>NSLookup www.Google.com . . . & echo. nslookup www.google.com echo ^>NSLookup 8.8.8.8 [ www.Google.com ] . . . & echo. nslookup 8.8.8.8 echo ^>Press ANY key to EXIT . . . & pause >nul & Exit
I have deliberately used Google TWICE onping
andtracert
to give more thorough diagnostic results.
If it is OK, then I will obviously Post it as an attachment, and possibly add the Script underneath. This way, any members that want to use it in Posts, can.
I doNOT
intend to add ANYTHING else to the above as this is just an initial collection of data results that may help with quicker diagnosis and resolution.
Thanks.
Last edited by Paul Black; 13 Sep 2022 at 04:45.