Repair Winsock2 registry and directories
Version: 36.2
Revision: 47 Build 132
Repair Winsock2 registry and directories
Windows: MediaCenter 2005, Xp Pro + Home (Sp2+)
Introduction: when I was at somebody else house, their internet connection looks damaged.
So, after three hours fixing their computer’s registry – library, Windows directory and some of the ActiveX files, I’ve managed to repair their “Winsock2” file without looking at other people’s article.
This article is useful if you’re infected with a previous virus infection that corrupts your Winsock from functioning properly. However, this article should be use with caution and it should only be operated with a specialist or somebody who has better knowledge in computers.
Copyright Notice: this article was written from scratch.
There isn’t any copying or stealing involved…
—————————
Problems: 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. So, how can you exactly tell when you have a damaged Winsock2 file?
Click Start >> Run >> Type: cmd >> Type: ****
Tips: replace the **** with these commands…
—————————
ipconfig /all
ipconfig /release
ipconfig /renew
—————————
After the command execution, you’ll receive the following message which is similar: “An error occurred while renewing interfaces ‘Internet’: An operation was attempted on something that is not a socket.”
Notes: you might receive this error when you’re trying to use “Internet Explorer”: “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.”
Please be aware; this is not your firewall which is blocking your connection with the server / ISP provider…
Tips: if you have windows Xp cd-rom (Sp2+), you can use this command to reset your winsock2 registry entries.
—————————
netsh winsock reset catalog
—————————
Option One: How to reset “Winsock2 LSP” registry binary
—————————
1.] Click Start >> Run >> Type: cmd >> Type: netsh winsock reset catalog
Notes: If you want to ‘output’ the results in a text file, you can use this command instead of the above…
Command: netsh winsock reset catalog >C:\lsp_fix.txt
Warning: this command should be used with care, because any previously-installed LSPs will need to be re-installed.
2.] Optional: if you want to output a list of “Winsock LSPs” which are installed on the computer, you can use this command…
Command: netsh winsock show catalog >C:\lsp.txt
3.] Finish
—————————
Option Two: verifying Winsock2 manually
—————————
Description: if the first option fails, you can use this option to fix “Winsock2”.
However, this is only for advance users…
1.] Check your Protocol – network.
—————————
Click Start >> Run >> Type: Msinfo32
—————————
2.] Click on the ‘+’ symbol which is next to the Components
3.] Click on the ‘+’ symbol which is next to the Network
4.] Select: “Protocol” (without the quotes)
5.] Take a look at your Winsock2 keys. There should be (at least) 10 sections and no less than 10 sections…
Notes: if you have any 3rd party software installed, the name MSAFD may have been changed.
6.] If yours is under 10 sections, then you’ll need to repair Winsock…
Click Start >> Run >> Type: Regedit and click OK.
7.] Delete the following registry keys…
—————————
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Winsock
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Winsock2
—————————
Notes: you can use this source and save it as a “.reg” file (without the quotes)
—Copy Source Code—
Windows Registry Editor Version 5.00 [-HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Winsock] [-HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Winsock2]
—End Source Code—
Copyright 2001-2008 Lair360
Here is ‘vbscript’ version…
—Copy Source Code—
'Version: 22.1 black bird
'Revision: 66 Build 32
'Author: Lair360
'Deletes corrupted winsock2 registry files
'----------------------------------------
On Error Resume Next
'Remove Winsock directory from local machine.
'----------------------------------------
Const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
strKeyPath = "System\CurrentControlSet\Services\Winsock"
'----------------------------------------
Set objRegistry = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")
DeleteSubkeys HKEY_LOCAL_MACHINE, strKeypath
Sub DeleteSubkeys(HKEY_LOCAL_MACHINE, strKeyPath)
objRegistry.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubkeys
If IsArray(arrSubkeys) Then
For Each strSubkey In arrSubkeys
DeleteSubkeys HKEY_LOCAL_MACHINE, strKeyPath & "\" & strSubkey
Next
End If
objRegistry.DeleteKey HKEY_LOCAL_MACHINE, strKeyPath
End Sub
'----------------------------------------
'Remove Winsock2 directory from local machine.
'----------------------------------------
On Error Resume Next
strComputer = "."
strKeyPath = "System\CurrentControlSet\Services\Winsock2"
Set objRegistry = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")
DeleteSubkeys HKEY_LOCAL_MACHINE, strKeypath
Sub DeleteSubkeys(HKEY_LOCAL_MACHINE, strKeyPath)
objRegistry.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubkeys
If IsArray(arrSubkeys) Then
For Each strSubkey In arrSubkeys
DeleteSubkeys HKEY_LOCAL_MACHINE, strKeyPath & "\" & strSubkey
Next
End If
objRegistry.DeleteKey HKEY_LOCAL_MACHINE, strKeyPath
End Sub
'----------------------------------------
'End of Winsock2 removal
'http://lair360.co.uk
—End Source Code—
Copyright 2001-2008 Lair360
8.] Reboot your computer
9.] Go to internet connection
Click Start >> Connect To >> Show all connections
10.] Right click and select: Properties
11.] Click on the Install button
12.] Select: Protocol
13.] Click on the “Add” button (without the quotes)
14.] Click on the “Have Disk” button
15.] Browse to: C:\Windows\inf directory
16.] Click on the Open button
17.] Click on the “OK” button
18.] Highlight Internet Protocol (TCP/IP)
19.] Click on the OK button
20.] Reboot your Computer (again).
21.] Finish!
Notes: you can also use this registry file to recover / import the correct registries back in. Then reboot the computer.
Download: http://www.filefactory.com/file/afh81cg/n/Winsock2_repair_rar
http://www.mediafire.com/file/ovmydcijyzq/Winsock2_repair.rar


