Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Network information to fix Network problems.

14 Oct 2019   #1
Paul Black

Win 7 HP SP1 64-bit Vista HB SP2 32-bit Linux Mint 18.3
 
 
Network information to fix Network problems.

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.


My System SpecsSystem Spec
.
3 Weeks Ago   #2
RolandJS

Windows 7 Professional 64-bit
 
 

Make sure I am on your list to get this. :)
My System SpecsSystem Spec
3 Weeks Ago   #3
samuria

win 8 32 bit
 
 

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
My System SpecsSystem Spec
.

3 Weeks Ago   #4
Paul Black

Win 7 HP SP1 64-bit Vista HB SP2 32-bit Linux Mint 18.3
 
 

Hi samuria,

Quote   Quote: Originally Posted by samuria View Post
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 => 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 System SpecsSystem Spec
3 Weeks Ago   #5
Paul Black

Win 7 HP SP1 64-bit Vista HB SP2 32-bit Linux Mint 18.3
 
 

Hi samuria,

Quote   Quote: Originally Posted by samuria View Post
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.

Quote   Quote: Originally Posted by samuria View Post
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 System SpecsSystem Spec
3 Weeks Ago   #6
Paul Black

Win 7 HP SP1 64-bit Vista HB SP2 32-bit Linux Mint 18.3
 
 

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 System SpecsSystem Spec
Reply

 Network information to fix Network problems.




Thread Tools




Similar help and support threads
Thread Forum
Missing information in the Network and Sharing Center screen Windows 7
Well the best way to describe my problem is through a screen shot of it. All start when I was trying to do a stream in Windows media Player. So when I went to the Network and Sharing center I couldn’t find a lot of info there, such as : Basic network info, it show only - Unknown- No -...
Network & Sharing
Inconsistent networking problems, unrelated to network or network card
Hi folks, This forum has been extremely helpful for me in the past, so I'm testing your awesomeness once again. I've had an unusual networking problem for about a year and a half. When browsing the web, certain requests will just never complete, on any browser. Downloads are often...
Network & Sharing
Problems with wireless network adapter and network connection driver
Hi, So recently I have removed a nasty zeroaccess rootkit virus(es) from my laptop. My Windows Firewall, Defender and Updates would not work (still won't), my browser kept redirecting to unrelated websites, and I was just overall having a TON of irritating issues. I installed MalwareBytes and...
Network & Sharing
problems with network icon and in network and sharing center
whenever i connect to the internet through dial up connection the network icon in the notification area still displays (not connected ) and when i go to the network and sharing it says not connected, ALTHOUGH i can surf the internet with no problems , AND when i insert the Ethernet cable it doesn't...
Network & Sharing
Network Problems
Hi all, I'm having several problems which I think all may stem from the same root. I took my computer on my vacation with me and did nothing/very little with it online. It was when I got back that problems started. First off, my FTP program, FileZilla, no longer works. I tried two other...
Network & Sharing


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd

All times are GMT -5. The time now is 07:57.
Twitter Facebook