Monday, May 30, 2016

Windows Winsock Repair

A few weeks ago it was brought to my attention that the XP desktop system sitting in our church-house library hasn’t been able to get on the Internet for quite some time.

(Yes…I said “XP”…moving on…)

I tried to argue that this sounded like a security feature rather than a problem but it was explained to me that the librarian used software on that system to catalog new book arrivals. One feature of that software was to look up the ISBN to pre-populate the database record it creates.

Turns out the system had a number of issues.

I had to remove quite a lot of third-party junkware from the system; (at least) one of which it turns out messed up the network/WinSock settings of the OS.

The net result was basically that no web-browser could reach the Internet.

After the system was cleaned up of all the junkware and auto-start crud, I had to clean up the network settings and fix the WinSock settings.

In the end I just followed the steps in this Microsoft KB: How to determine and to recover from Winsock2 corruption in Windows Server 2003, in Windows XP, and in Windows Vista

Manual steps to recover from Winsock2 corruption
Windows XP with Service Pack 2 instructions

To repair Winsock if you have Windows XP Service Pack 2 (SP2) installed, type netsh winsock reset at the command prompt, and then press ENTER.

Note Restart the computer after you run this command. Additionally, for computers that are running Windows XP SP2, there is a new netsh command that can rebuild the Winsock key. For more information, visit the following Web site:

http://technet.microsoft.com/en-us/library/bb457156.aspx

Warning Programs that access or monitor the Internet such as antivirus, firewall, or proxy clients may be negatively affected when you run the netsh winsock reset command. If you have a program that no longer functions correctly after you use this resolution, reinstall the program to restore functionality.

Note If these steps do not resolve the problem, follow the steps in the next section.

Windows XP without Service Pack 2 instructions
To repair Winsock if you do not have Windows XP SP2 installed, delete the corrupted registry keys, and then reinstall the TCP/IP protocol.
Step 1: Delete the corrupted registry keys
Important This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following article number to view the article in the Microsoft Knowledge Base:

322756 How to back up and restore the registry in Windows

For more information about how to back up the registry, click the following article number to view the article in the Microsoft Knowledge Base:

322756 How to back up and restore the registry in Windows XP and Windows Vista

  1. Click Start, and then click Run.
  2. In the Open box, type regedit, and then click OK.
  3. In Registry Editor, locate the following keys, right-click each key, and then click Delete:

    HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Winsock
    HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Winsock2

  4. When you are prompted to confirm the deletion, click Yes.
Note Restart the computer after you delete the Winsock keys. Doing so causes the Windows XP operating system to create new shell entries for those two keys. If you do not restart the computer after you delete the Winsock keys, the next step does not work correctly.
Step 2: Install TCP/IP
  1. Right-click the network connection, and then click Properties.
  2. Click Install.
  3. Click Protocol, and then click Add.
  4. Click Have Disk.
  5. Type C:\Windows\inf, and then click OK.
  6. On the list of available protocols, click Internet Protocol (TCP/IP), and then click OK.
    If Internet Protocol (TCP/IP) does not appear, follow these steps:
    1. Click Start, and then click Search.
    2. In the Search Companion pane, click More advanced options.
    3. Click to select the following three check boxes:
      • Search system folders
      • Search hidden files and folders
      • Search subfolders
    4. In the All or part of the file name box, type nettcpip.inf, and then click Search.
    5. In the results pane, right-click Nettcpip.inf, and then click Install.
  7. Restart the computer.

The real “trick” for me was in Step 2.5 above.  You need to actually type “C:\Windows\inf” as it says. If you try to browse to the folder in the GUI you won’t “see” the folder present. Type it in and the protocols appear as documented above.

Once the PC was restarted I manually set the network configuration to the proper static IP the system should use along with custom DNS server values.

If you don’t want to go through all that manual work, you could try the Microsoft FixIt (50203) download link and save/run that file.

There are also a lot of third-party utilities that can fix WinSock issues. I like to keep these along with the Microsoft FixIT file handy just in case:

Cheers,

Claus Valca

No comments: