Repairing Damaged Winsock2 in Windows XP

Monday, November 17, 2008 19:40

Many times after a Microsoft Windows update, software install or driver install for one of your PCI devices you end up with a corrupted  or damaged Winsock2 file. How can you tell when you have a damaged Winsock2 file you ask?

When you try and run IPCONFIG / ALL, IPCONFIG / RELEASE or IPCONFIG / RENEW and you recieve the following message.

An error occurred while renewing interface ‘Internet’: An operation was attempted on something that is not a socket.

You also may recieve an error message in Internet Explorer with the following error message:

The page cannot be displayed Additionally, you may have no IP address or no Automatic Private IP Addressing (APIPA) address, and you may be receiving IP packets but not sending them.

If you have Microsoft Windows XP with Service Pack 2 installed, there is a one line command you can run to reset the winsock2 registry entries.

netsh winsock reset catalog

There are two easy ways to determine if Winsock2 is damaged:

From the Windows XP source files, go to the Support / Tools directory

Winsock Test Method 1
Run netdiag /test:winsock

The end should say Winsock test ….. passed

Winsock Test Method 2

  1. Run Msinfo32
  2. Click on the + by Components
  3. Click on the by Network
  4. Click on Protocol
  5. There should be 10 sections if the Winsock2 key is ok

MSAFD Tcpip [TCP/IP]
MSAFD Tcpip [UDP/IP]
RSVP UDP Service Provider
RSVP TCP Service Provider
MSAFD NetBIOS [\Device\NetBT_Tcpip…
MSAFD NetBIOS [\Device\NetBT_Tcpip…
MSAFD NetBIOS [\Device\NetBT_Tcpip…
MSAFD NetBIOS [\Device\NetBT_Tcpip…
MSAFD NetBIOS [\Device\NetBT_Tcpip…
MSAFD NetBIOS [\Device\NetBT_Tcpip…

If the names are anything different from those in this list, then likely Winsock2 is corrupted and needs to be repaired.

If you have any 3rd party software installed, the name MSAFD may have been changed.

There should be no fewer than 10 sections.

To repair Winsock2

  1. Go to Start -> Run -> Type: Regedit and click OK.
  2. Delete the following two registry keys:

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

Or Download The Reg file to delete these entries

  1. Now Restart the computer
  2. Go to Network Connections
  3. Right click and select Properties
  4. Click on the Install button
  5. Select Protocol
  6. Click on the Add  button
  7. Click on the Have Disk button
  8. Browse to the \Windows\inf directory
  9. Click on the Open button
  10. Click on the OK button
  11. Highlight Internet Protocol (TCP/IP)
  12. Click on the OK button
  13. Now Reboot your Computer

   Or Download Reg file to add the correct registries back in. Then reboot the computer.

Shawn DesRochers

Found this post useful? Buy me a coffee.

1 Star2 Stars3 Stars4 Stars5 Stars (5 votes, average: 4.80 out of 5)
Loading ... Loading ...
You can leave a response, or trackback from your own site.

5 Responses to “Repairing Damaged Winsock2 in Windows XP”

  1. Govindaya says:

    February 8th, 2009 at 9:41 am

    Of course, what a great site and informative posts, I will add backlink – bookmark this site? Regards, Reader.

  2. Haraye says:

    February 9th, 2009 at 4:34 am

    It sounds like you’re creating problems yourself by trying to solve this issue instead of looking at why their is a problem in the first place.

  3. Hamsaaya says:

    February 16th, 2009 at 10:23 am

    Super-Duper site! I am loving it!! Will come back again – taking you feeds also, Thanks.

  4. Danelle Hoffler says:

    April 27th, 2009 at 10:30 am

    Hi, I cant understand how to add your site in my rss reader. Can you Help me, please :)

  5. google explorer says:

    February 2nd, 2010 at 4:14 pm

    Nice experience

Leave a Reply

Please note: Use of the comment field is subject to our terms. Any comments that are off-topic, personal attacks will likely be removed at my discretion.