在Windows XP(简称Windows XP)的连接属性对话框中,如果点击“Internet协议(TCP/IP)选项,“卸载”按钮为灰色,是不可用的。这是因为TCP/IP协议是Windows Server XP的核心组件,不能删除。
|
|
如果我们需要将TCP/IP重置到原始状态,该怎么办呢?此时,我们可以借助“netsh”命令行工具来解决这一问题。在“运行”对话框中输入“cmd”,打开“命令提示符”窗口,然后输入命令行“netsh int ip reset resetlog.txt”或“netsh int ip reset c:/resetlog.txt”并按回车键。其中的“reset”命令可以重写与TCP/IP相关的注册表项“System/CurrentCon trolSet/Services/Tcpip/Parameters/”和“System/CurrentControlSet/Services/DHCP/Parame ters/”,运行以上命令的结果与删除并重新安装TCP/IP的效果相同。
此外,两个命令行的不同之处仅仅在于“resetlog.txt”日志文件的存储位置有所区别。前者是将日志文件创建在当前文件夹中,而后者则指定了具体的保存路径。
步骤:
1. 开始,运行。
2. 输入CMD,回车。
3. 输入“netsh int ip reset resetlog.txt”或“netsh int ip reset c:/resetlog.txt”,回车。
或者:
打开CMD后先输入netsh
提示符会变成netsh>
之后输入interface
变成netsh>interface>再输入ip
变成netsh>interface>ip再输入reset c:/resetlog.txt 回车。
完成后你会在C盘根目录下看到resetlog.txt 这个文件,成功的话里面的内容为<completed>。
c:/>netsh
netsh>interface
netsh interface>ip
netsh interface ip>reset c:/resetlog.txt
关于reset这个参数在2000中可能要换成reset all,即“netsh int ip reset all c:/resetlog.txt”。
下面是微软的KB
如何在 Windows XP 中重置 Internet 协议 (TCP/IP)
http://support.microsoft.com/kb/CHS299357/ZH-CN/
概要
卸载按钮。在 Windows XP 中,TCP/IP 栈被视为操作系统的核心组件;因此 Windows XP 中不能卸载 TCP/IP。
在某些极端情况下,重新安装 Internet 协议栈可能是最合适的解决方案。使用 NetShell 实用程序,您可以将 TCP/IP 栈重置为初始状态,即与安装操作系统时相同的状态。
更多信息
netsh) 是一个命令行脚本接口,用于配置和监控 Windows XP 网络。此工具为用户提供了交互式的网络 Shell 接口。
在 Windows XP 中,
reset 命令在 NetShell 实用程序的 IP 上下文中可用。当执行此命令时,它重写 Internet 协议 (TCP/IP) 栈使用的相关注册表项,实现与删除并重新安装协议相同的结果。
SYSTEM/CurrentControlSet/Services/Tcpip/Parameters/
SYSTEM/CurrentControlSet/Services/DHCP/Parameters/
命令使用
netsh int ip reset [log_file_name]
若要成功执行此命令,您必须指定一个日志文件名称,
netsh 执行的操作将被记录在该日志文件中。例如,在命令提示符处键入本文稍后“命令示例”一节中列出的任何一个示例都将重置系统上的 TCP/IP 栈并将执行的操作记录在日志文件 Resetlog.txt 中。第一个示例在当前目录中创建日志文件,而第二个示例演示在指定的路径中创建日志。不管是哪种情况,如果指定的日志文件已存在,则新日志将附加在现有文件的末尾。
命令示例
netsh int ip reset resetlog.txt
netsh int ip reset c:/resetlog.txt
以下可以略过不看
NETSH INT IP RESET 的示例日志文件
以下是发出 IP 重置命令后
netsh 生成的日志文件的示例。根据发出命令的系统上不同的配置,实际的日志文件也会有所不同。在某些情况下,该文件中可能未记录任何操作。通常如果未从原始配置更改 TCP/IP 注册表项,则会出现这种情况。
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
<completed>
这篇文章中的信息适用于:
Microsoft Windows XP Professional Edition |
Microsoft Windows XP Home Edition |