Sometimes, the whole process of repairing a network connection might not be fit. Also, due to various reasons, there are times when you can’t use the actual repair option from the GUI (Graphical User Interface). The reasons could be: lack of rights on current username, option not available (not accepted by different parties who should benefit of the result),  faster and are more accessible variants for the actual GUI like a command or script to run some commands and last but not least, the transparent process might not be so trust worthy in some cases.

What does a Repair Network Connection actually do ?

Well, it is a background process that follows a procedure and fulfills some tasks which reset some network parameters values. The actual process doesn’t really execute the commands I will explain below, but, in correspondence, the commands represent the parameters that will be fixed by the repair option.

I will also do a short presentation on each network term and what it means when encountered, so you will know what are the changes that the actual command does.

ipconfig /release – Dynamic Host Configuration Protocol (DHCP) lease is released. The current network credentials provided by DHCP server are dropped.

ipconfig /renew – Dynamic Host Configuration Protocol (DHCP) lease is renewed. Computer is asking for new network credentials from DHCP server and will apply them as soon as they are provided and confirmed.

nbtstat -R – Purges and Reloads the NetBIOS name cache. The NetBIOS cache contains the “list of mapping” for every NetBIOS name associated with an IP address. This local cache reduces network traffic by eliminating the need for broadcasting or WINS queries.

nbtstat -RR – NetBIOS name update is sent. Sends Name Release packets to WINS and then starts the actual Refresh.

ipconfig /flushdns – Domain Name System (DNS) cache is flushed. A DNS cache contains entries that translate Internet domain names and FQDNs to IP addresses. You might have a problem in here if, for example, you pinged a domain not available at a certain time and the DNS cache remembers for a few minutes that the address is unreachable, so even if you ping again and the domain is working, you might still get a negative reply. Using this command will remove that temporary memory that the address was unreachable and will process and save the new live requests. In other words, the domain from the example will now work.

ipconfig /registerdns – Renews the DNS name registration. This command allows you to manually initiate dynamic registration for the DNS names and IP addresses. This means the command refreshes all the DHCP address leases and it also registers all associated DNS names configured and used by the client computer.

IEEE 802.1X Authentication Restart – I couldn’t find any command to initiate this, being the only thing you cannot do via command but there is always the repair option that can do it. It doesn’t really matter since is not as critical as any of the other parameters we talked about and it never fails at this level. This is one of the reasons you won’t see this one being too mentioned in other sources that talk about the same thing, but I was thinking you should at least know it exists.

In my opinion this is just a part of the actual parameters you should reset if you want a fully initiated network connection, but this is how it is documented.

I will also add the rest of the commands I would use to reset the network connectivity credentials and I will explain those I didn’t already cover in below section.

Note: You should save the following commands inside a batch script to run it automatically just by calling it or with a double-click. You could name it RepairLAN.bat or whatever you seem fit.

route -f
ipconfig /release
ipconfig /renew
arp -d *
nbtstat -R
nbtstat -RR
ipconfig /flushdns
ipconfig /registerdns

route -f – Clears the routing tables of all gateway entries. This means it will delete all routing entries from the local computer where you run this command. You can check this with “route print” command inside a cmd. The routes will be added back after you get the network credentials from your DHCP server due to “ipconfig /renew” command.

arp -d * – Clears the ARP cache. This command will delete all ARP entries from the cache. The ARP table or Address Resolution Protocol (ARP) cache contains entries that are used to store IP addresses and their resolved Ethernet physical addresses.

Now depending on your needs this might help you or not. I saw cases when people were searching for something similar but this script and the commands inside were not enough. They wanted the same thing but in a different way.

When I was about to recommend a few third party software which might work pretty good, the things got even more complicated and they said the party software is excluded. They want it just with what Windows Xp offers, nothing else, due to the external requests that the image should not be modified or altered with new software.

As I could go on for at least a few hours only on this subject with the commands and third party tools you can enable/disable/repair Network Connections I won’t do it and I’d rather give you a hint and leave the rest of you to put questions, send me messages via Contact form or comments. It would help you and me treat each case accordingly instead of me writing tons of lines about different methods and you reading until you will find or not what you seek for.

netsh interface set interface “Local Area Connection” DISABLED

netsh interface set interface “Local Area Connection” ENABLE

Both of these commands work only for windows 2003, tested on Windows XP and even if documentation says they should work, according to command syntax, they don’t. Also, if you search more, Microsoft recommends to disable and enable from device manager or network connections but is useless.

A third party tool that might help you do something close to a repair would be http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q311272. Now, this could be quite inefficient since disabling and enabling on network connection would reset the most important of the parameters already presented.

So, we have alternatives like disable/enable via command, I can find and create for you scripts (vbscript mostly as this works among the best for such requests), methods and ways to bypass some of the lacks of Windows XP in this point of view. There are also many more third party software and I’m pretty sure the WMI ( Windows Management Instrumentation ) Command Line Tool has something that could help, but I won’t waste resources on this unless I know someone needs it.

This is the reason why I encourage you to ask me…give me your straight through example or what you actually need, present your situation to me and I will provide you with a possible solution, even more so you can pick, and I’ll do it as soon as possible, which normally means a few hours maximum. 🙂

VN:F [1.9.22_1171]
Rating: 5.0/5 (3 votes cast)
Repair Network Connection - Command line representation, 5.0 out of 5 based on 3 ratings