You are here:  Blog
Saturday, July 31, 2010
Full Text Search
There are no categories in this blog.
Nov 24

Written by: John Shoff
November 24, 2009 2:43 PM 

In certain circumstances, usually due to a virus, the TCP/IP stack, and WINSOCK reg data, and files can become unstable, or corrupted.  Usually this means a rebuild, however you can run the steps below to prevent such work.

The Netsh.exe utility (netsh) is a command-line scripting tool that you can use to configure and monitor Windows Server 2003 networking. This tool gives you an interactive network shell interface.
 

You can use the reset command in the Internet Protocol (IP) context of this utility to rewrite the following TCP/IP-related registry keys:

  • SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\
  • SYSTEM\CurrentControlSet\Services\DHCP\Parameters\

If you run this command, you get the same result as if you removed and reinstalled the TCP/IP protocol.

Warning The netsh int ip reset command will reset all IP information, default gateway information, and DNS server information. Before you restart the computer after you run this command, you must configure your TCP/IP settings. Otherwise, you may not be able to connect to the computer remotely.

Command syntax

netsh int ip reset [log_file_name]

To use the netsh command to reset the TCP/IP stack, you must specify a log file name in which the results of the command are recorded. If you enter either of the commands that are described in the "Command Samples" section of this article, the TCP/IP stack on the current computer is reset, and the activities of that action are recorded in the Resetlog.txt file that is specified in the command line. In the first example, the log file is created in the current folder; in the second example, a complete path to the Resetlog.txt log file is specified.

Note If an existing log file with the same name is present in the target folder, the new log file information is appended to the end of the existing file.

Command samples

The following examples describe how to use the netsh command to reset the TCP/IP protocol stack.

Example 1

  1. Click Start, and then click Run.
  2. In the Open box, type cmd, and then click OK.
  3. At the command prompt, type the following command, and then press ENTER:
    netsh int ip reset resetlog.txt
    NOTE: In the preceding command, "int" is the shortened form of the interface command.
  4. Type exit, and then press ENTER.

Example 2

  1. Click Start, and then click Run.
  2. In the Open box, type cmd, and then click OK.
  3. At the command prompt, type the following command, and then press ENTER:
    netsh int ip reset c:\resetlog.txt
  4. Type exit, and then press ENTER.

To view help for the command, type the command, type a space, and then type ?. Additional help is available for commands in the sub-contexts of the netsh command. For example, to view help for the netsh commands that are described in the preceding section, type the following commands at the command prompt:

  • Type netsh ?, and then press ENTER.
  • Type netsh int ?, and then press ENTER.
  • Type netsh int ip ?, and then press ENTER.
  • Type netsh int ip reset ?, and then press ENTER.

Example of the log file for NETSH INT IP RESET

The following text is an example of the log file that is generated by netsh if you run the ip reset command. The actual log file may vary depending on the configuration of the computer on which you run the command. Typically, no actions are logged in the file if the TCP/IP registry keys have not been altered from their original configuration.

reset   SYSTEM\CurrentControlSet\Services\Dhcp\Parameters\Options\15\RegLocation
            old REG_MULTI_SZ =
                SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\?\DhcpDomain
                SYSTEM\CurrentControlSet\Services\TcpIp\Parameters\DhcpDomain

added   SYSTEM\CurrentControlSet\Services\Netbt\Parameters\Interfaces\Tcpip_{2DDD011E-B1B6-4886-87AC-B4E72693D10C}\NetbiosOptions
added   SYSTEM\CurrentControlSet\Services\Netbt\Parameters\Interfaces\Tcpip_{BAA9D128-54BB-43F6-8922-313D537BE03E}\NetbiosOptions
reset   SYSTEM\CurrentControlSet\Services\Netbt\Parameters\Interfaces\Tcpip_{BD2859BA-B26A-4E2B-A3FE-3D246F90A81A}\NameServerList
            old REG_MULTI_SZ =
                10.1.1.2

deleted SYSTEM\CurrentControlSet\Services\Netbt\Parameters\EnableLmhosts
added   SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{2DDD011E-B1B6-4886-87AC-B4E72693D10C}\AddressType
added   SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{2DDD011E-B1B6-4886-87AC-B4E72693D10C}\DefaultGatewayMetric
added   SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{2DDD011E-B1B6-4886-87AC-B4E72693D10C}\DisableDynamicUpdate
deleted SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{2DDD011E-B1B6-4886-87AC-B4E72693D10C}\DontAddDefaultGateway
reset   SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{2DDD011E-B1B6-4886-87AC-B4E72693D10C}\EnableDhcp
            old REG_DWORD = 0

added   SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{2DDD011E-B1B6-4886-87AC-B4E72693D10C}\NameServer
added   SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{2DDD011E-B1B6-4886-87AC-B4E72693D10C}\RawIpAllowedProtocols
added   SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{2DDD011E-B1B6-4886-87AC-B4E72693D10C}\TcpAllowedPorts
added   SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{2DDD011E-B1B6-4886-87AC-B4E72693D10C}\UdpAllowedPorts
added   SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{5B3675C3-6EB9-4936-B991-04DA31024C4E}\DisableDynamicUpdate
reset   SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{5B3675C3-6EB9-4936-B991-04DA31024C4E}\EnableDhcp
            old REG_DWORD = 0

reset   SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{5B3675C3-6EB9-4936-B991-04DA31024C4E}\IpAddress
            old REG_MULTI_SZ =
                12.12.12.12

deleted SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{5B3675C3-6EB9-4936-B991-04DA31024C4E}\IpAutoconfigurationAddress
deleted SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{5B3675C3-6EB9-4936-B991-04DA31024C4E}\IpAutoconfigurationMask
deleted SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{5B3675C3-6EB9-4936-B991-04DA31024C4E}\IpAutoconfigurationSeed
reset   SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{5B3675C3-6EB9-4936-B991-04DA31024C4E}\RawIpAllowedProtocols
            old REG_MULTI_SZ =
                0

reset   SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{5B3675C3-6EB9-4936-B991-04DA31024C4E}\SubnetMask
            old REG_MULTI_SZ =
                255.255.255.0

reset   SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{5B3675C3-6EB9-4936-B991-04DA31024C4E}\TcpAllowedPorts
            old REG_MULTI_SZ =
                0

reset   SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{5B3675C3-6EB9-4936-B991-04DA31024C4E}\UdpAllowedPorts
            old REG_MULTI_SZ =
                0

added   SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{BAA9D128-54BB-43F6-8922-313D537BE03E}\AddressType
added   SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{BAA9D128-54BB-43F6-8922-313D537BE03E}\DefaultGatewayMetric
added   SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{BAA9D128-54BB-43F6-8922-313D537BE03E}\DisableDynamicUpdate
deleted SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{BAA9D128-54BB-43F6-8922-313D537BE03E}\DontAddDefaultGateway
reset   SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{BAA9D128-54BB-43F6-8922-313D537BE03E}\EnableDhcp
            old REG_DWORD = 0

added   SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{BAA9D128-54BB-43F6-8922-313D537BE03E}\NameServer
added   SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{BAA9D128-54BB-43F6-8922-313D537BE03E}\RawIpAllowedProtocols
added   SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{BAA9D128-54BB-43F6-8922-313D537BE03E}\TcpAllowedPorts
added   SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{BAA9D128-54BB-43F6-8922-313D537BE03E}\UdpAllowedPorts
reset   SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{BD2859BA-B26A-4E2B-A3FE-3D246F90A81A}\DefaultGateway
            old REG_MULTI_SZ =
                10.1.1.2
                

reset   SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{BD2859BA-B26A-4E2B-A3FE-3D246F90A81A}\DefaultGatewayMetric
            old REG_MULTI_SZ =
                0
               

added   SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{BD2859BA-B26A-4E2B-A3FE-3D246F90A81A}\DisableDynamicUpdate
reset   SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{BD2859BA-B26A-4E2B-A3FE-3D246F90A81A}\EnableDhcp
            old REG_DWORD = 0

reset   SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{BD2859BA-B26A-4E2B-A3FE-3D246F90A81A}\IpAddress
            old REG_MULTI_SZ =
                10.1.1.1
               

deleted SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{BD2859BA-B26A-4E2B-A3FE-3D246F90A81A}\IpAutoconfigurationAddress
deleted SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{BD2859BA-B26A-4E2B-A3FE-3D246F90A81A}\IpAutoconfigurationMask
deleted SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{BD2859BA-B26A-4E2B-A3FE-3D246F90A81A}\IpAutoconfigurationSeed
reset   SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{BD2859BA-B26A-4E2B-A3FE-3D246F90A81A}\NameServer
            old REG_SZ = 10.1.1.2,10.1.1.3

reset   SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{BD2859BA-B26A-4E2B-A3FE-3D246F90A81A}\RawIpAllowedProtocols
            old REG_MULTI_SZ =
                0

reset   SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{BD2859BA-B26A-4E2B-A3FE-3D246F90A81A}\SubnetMask
            old REG_MULTI_SZ =
                255.255.255.0
               

reset   SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{BD2859BA-B26A-4E2B-A3FE-3D246F90A81A}\TcpAllowedPorts
            old REG_MULTI_SZ =
                0

reset   SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{BD2859BA-B26A-4E2B-A3FE-3D246F90A81A}\UdpAllowedPorts
            old REG_MULTI_SZ =
                0

deleted SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\DontAddDefaultGatewayDefault
deleted SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\EnableIcmpRedirect
deleted SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\EnableSecurityFilters
deleted SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\SearchList
deleted SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\UseDomainNameDevolution

				

Note In Windows Server 2003 Service Pack 1, you can use the netsh winsock reset command to repair Winsock.

Warning Programs that access or monitor the Internet, such as antivirus programs, firewall programs, 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.

The full knowledgebase article is here

Copyright ©2009 John Shoff

Tags:

Your name:
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Title:
Comment:
Security Code
Enter the code shown above in the box below
Add Comment   Cancel 
 
 
Privacy Statement | Terms Of Use (C) Reality Bytes Incorporated - CALL 1.888.887.BYTE