Network information to fix Network problems.

Paul Black

I WANT TO BELIEVE!
Guru
VIP
Local time
10:57 AM
Messages
3,823
Location
Planet Earth VGhlIFgtRmlsZXM=
I am trying to put a batch script together in order to help members resolve their network problems. When there are problems, we often ask them to run certain commands from the cmd prompt. My idea is to either have one general option that will hopefully fix the problem, or have different options for different problems. Using a batch script will make doing this easier and possibly avoid typing errors. The user will only need to select a particular option and then press enter. The batch script will do the rest [hopefully].

I have investigated and found what appears to be the general solutions that seems to fix the majority of network issues.

In order to be able to write the batch script I need advice on what should and shouldn’t be used, and in what situations they should be used, therefore I can write the script accordingly. I have added [restart needed] next to those that I understand need it!

ipconfig /flushdns
ipconfig /registerdns
ipconfig /release
ipconfig /renew
nbtstat -R
nbtstat -RR
net stop dnscache
netsh advfirewall reset [restart needed]
netsh int ip reset [restart needed]
netsh int ip reset c:\resetlog.txt [restart needed]
netsh int ipv4 reset [restart needed]
netsh int ipv6 reset [restart needed]
netsh int reset all [restart needed]
netsh interface ipv4 reset [restart needed] - SAME AS netsh int ipv4 reset ABOVE
netsh interface ipv6 reset [restart needed] - SAME AS netsh int ipv6 reset ABOVE
netsh interface tcp reset [restart needed] - SAME AS netsh int ip reset ABOVE
netsh interface tcp set global autotuninglevel=disabled
netsh winsock reset [restart needed]
netsh winsock reset catalogue [restart needed]
ping 127.0.0.1 -n 10 & ping localhost -n 10

EDIT1:
Here is a brief description of what each of the above commands perform as far as I can make out and understand . . .

ipconfig /flushdns
Flushes the DNS resolver cache on the local computer.

ipconfig /registerdns
Registers the DNS name.

ipconfig /release
Releases the current DHCP server IP address [configuration settings] for all connected adapters.

ipconfig /renew
Renews the DHCP server IP address [configuration settings] for all connected adapters.

nbtstat -R
Reloads of the NetBIOS name cache.

nbtstat -RR
NetBIOS name update is sent.

net stop dnscache
Stops the DNS cache service.

netsh advfirewall reset [restart needed]
Resets the firewall to factory settings [Firewall=ON].

netsh int ip reset [restart needed]
Reset the TCP/IP Stack Protocols and reset all network interfaces to DHCP.

netsh int ip reset c:\resetlog.txt [restart needed]
Rewrites two registry keys used by TCP/IP.

netsh int ipv4 reset [restart needed]
Reset the IPv4 Protocol.

netsh int ipv6 reset [restart needed]
Reset the IPv6 Protocol.

netsh int reset all [restart needed]
Reinstalls the TCP/IP protocol.

netsh interface tcp set global autotuninglevel=disabled
?????????

netsh winsock reset [restart needed]
Reset the WINSOCK programming interface entries to installation defaults.

netsh winsock reset catalogue [restart needed]
Resets the WINSOCK protocols back to the default setting or clean state.

ping 127.0.0.1 -n 10 & ping localhost -n 10
Ping the network card loopback address and local computer address.

EDIT2:
I have come up with a couple of different scenarios but I would ideally like input from those that know about pc networking before I finish writing the batch script!

Thanks in advance.
 
Last edited:

My Computer

Computer type
Laptop
Computer Manufacturer/Model Number
Fujitsu LIFEBOOK
OS
Win 7 HP SP1 64-bit Vista HB SP2 32-bit Linux Mint 18.3
CPU
Intel(R) Pentium(R) CPU P6200 @ 2.13GHz
Motherboard
FUJITSU FJNBB06
Memory
4.00 GB
Graphics Card(s)
Intel(R) Graphics Media Accelerator HD
Sound Card
[1] Realtek High Definition Audio [2] Intel(R) Display Audio
Screen Resolution
1366 x 768 x 32 bits (4294967296 colors) @ 59 Hz
Hard Drives
TOSHIBA MK5076GSX
Antivirus
AVG FREE
Make sure I am on your list to get this. :)
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Antec desktop; Acer Aspire laptops
OS
Windows 7 Professional 64-bit
CPU
Desktop i5; Acers i5 & i7
Memory
desktop 16GB; 1 Acer 8GB & 1 Acer 16GB
Hard Drives
1TB split into 2 equal partitions [OS and data] usable by RJS
Internet Speed
AT&T DSL
Browser
FF, GChrome, msIE
Other Info
Windows 7 Firewall, Emsisoft AM/AV, MSE [scan-only], SpywareBlaster, Ruiware/BillP combine
None of that gives info to resolve any problems like proxy in use,bad IP is 169 range bad DNS MTU


WE have a tool for that which does all networks www.crewetown.co.uk/wireless.exe
 
Last edited:

My Computer

Computer type
PC/Desktop
OS
win 8 32 bit
Hi samuria,

None of that gives info to resolve any problems like proxy in use, bad IP is 169 range, bad DNS, MTU.

WE have a tool for that which does all networks www.crewetown.co.uk/wireless.exe

Thanks for the info.

The batch file you posted is very similar to the one I wrote previously in My BATCH PROGRAMS [Standalone]. Here is the file => View attachment Network_Statistics_And_Diagnostics.bat.

Would MY file above be good for members that have network problems to run FIRST and then upload the Network_S_D.txt file that it produces for us to look at?

Would it then be good [for general network problems] for them to run in the order specified . . .

ipconfig /flushdns
ipconfig /release
ipconfig /renew /
netsh advfirewall reset
netsh winsock reset
netsh int ipv4 reset
netsh int ipv6 reset


Reboot

I can create a batch script that does the above for them.

Thanks in advance.
 

My Computer

Computer type
Laptop
Computer Manufacturer/Model Number
Fujitsu LIFEBOOK
OS
Win 7 HP SP1 64-bit Vista HB SP2 32-bit Linux Mint 18.3
CPU
Intel(R) Pentium(R) CPU P6200 @ 2.13GHz
Motherboard
FUJITSU FJNBB06
Memory
4.00 GB
Graphics Card(s)
Intel(R) Graphics Media Accelerator HD
Sound Card
[1] Realtek High Definition Audio [2] Intel(R) Display Audio
Screen Resolution
1366 x 768 x 32 bits (4294967296 colors) @ 59 Hz
Hard Drives
TOSHIBA MK5076GSX
Antivirus
AVG FREE
Hi samuria,

None of that gives info to resolve any problems like proxy in use.

For this I can add two options . . .

[1] For netsh.exe winhttp show proxy.
[2] For netsh.exe winhttp reset proxy.

Bad IP is 169 range.

For this I can use . . .

Batch Script . . .

Code:
@echo off
For /F "delims=: tokens=2" %%a In ('ipconfig ^| Find "IPv4"') Do Set _IPAddress=%%a
echo %_IPAddress%
Pause

Command Line . . . ipconfig | find "IPv4".
 

My Computer

Computer type
Laptop
Computer Manufacturer/Model Number
Fujitsu LIFEBOOK
OS
Win 7 HP SP1 64-bit Vista HB SP2 32-bit Linux Mint 18.3
CPU
Intel(R) Pentium(R) CPU P6200 @ 2.13GHz
Motherboard
FUJITSU FJNBB06
Memory
4.00 GB
Graphics Card(s)
Intel(R) Graphics Media Accelerator HD
Sound Card
[1] Realtek High Definition Audio [2] Intel(R) Display Audio
Screen Resolution
1366 x 768 x 32 bits (4294967296 colors) @ 59 Hz
Hard Drives
TOSHIBA MK5076GSX
Antivirus
AVG FREE
Hi samuria,

What about something like this . . .

Code:
@echo off
echo.
For /f "delims=: tokens=2" %%a In ('ipconfig ^| Find "IPv4"') Do Set _IPAddress=%%a
echo    IPv4 Address       :%_IPAddress%
For /f "delims=: tokens=2" %%a In ('ipconfig ^| Find "Subnet"') Do Set _Subnet=%%a
echo    Subnet Mask        :%_Subnet%
For /f "tokens=2,3 delims={,}" %%a In ('"WMIC NICConfig Where IPEnabled="True" Get DefaultIPGateway /value | Find "I" "') Do ^
echo    Default IP Gateway : %%~a
netsh.exe winhttp show proxy
Pause
 

My Computer

Computer type
Laptop
Computer Manufacturer/Model Number
Fujitsu LIFEBOOK
OS
Win 7 HP SP1 64-bit Vista HB SP2 32-bit Linux Mint 18.3
CPU
Intel(R) Pentium(R) CPU P6200 @ 2.13GHz
Motherboard
FUJITSU FJNBB06
Memory
4.00 GB
Graphics Card(s)
Intel(R) Graphics Media Accelerator HD
Sound Card
[1] Realtek High Definition Audio [2] Intel(R) Display Audio
Screen Resolution
1366 x 768 x 32 bits (4294967296 colors) @ 59 Hz
Hard Drives
TOSHIBA MK5076GSX
Antivirus
AVG FREE
Back
Top