Occasionally, I lose network connectivity while using my Windows XP system wirelessly. Of course, I can use the GUI to repair the connection, but that process can be irritating—it takes a long time to run on older machines, and I have to go through several dialog boxes. To simplify the process, I use a script that performs essentially the same job quickly and quietly. The script also works as a repair tool for wired connections, and runs on Windows Server 2003 and Windows Vista. Let me tell you how I developed the script, then discuss how to use it with Vista and Windows PowerShell.
Working with the Command Line
When I set out to write a short script for this process, I expected I'd be diving into the depths of Windows Management Instrumentation (WMI). However, I discovered that Microsoft has documented the rough command-line equivalent of the connection repair process in the article "A Description of the Repair Option on a Local Area Network or High-Speed Internet Connection" (http://support.microsoft.com/kb/289256). The command-line connectivity-repair process in the article consists of the following six commands:
ipconfig /renew
arp -d *
nbtstat -R
nbtstat -RR
ipconfig /flushdns
ipconfig /registerdns
This sequence of commands renews DHCP leases; flushes the Address Resolution Protocol (ARP) cache; reloads the NetBIOS cache and updates the NetBIOS name; and flushes the DNS cache and re-registers with DNS. . . .


sureshgro January 09, 2008 (Article Rating: