Do you know what netsh.exe can do for you? If you do not know.
First, it displays the settings of your TCP/IP protocol. In the Command Prompt window (CMD. EXE), enter the following command:
Netsh interface ip show config
You can also use it to change the IP address of a computer or configure other properties of TCP/IP. For example, if you want to specify a static IP address 192.168.0.100 for the "local connection" of your computer, and set its subnet mask? 55.255.255.0, and specify the default gateway as 192.168.0.1. You only need to enter the following command in the Command Prompt window:
Netsh interface ip set address name = "Local Area Connection" static 192.168.0.100 255.255.255.0 192.168.0.1 1
(Note: This is a complete command. Do not wrap it when entering it .)
To quickly switch the TCP/IP settings to meet the needs of different networks. Ntesh.exe can export different TCP/IP settings to different configuration files, and then import the configuration files as needed to change the corresponding settings.
For example, your laptop is now connected to network 1 and the corresponding network settings have been completed. In this case, you can enter the following in the Command Prompt window:
Netsh-c interface dump> c: location1.txt
Use this command to export the corresponding TCP/IP settings to a text file named location1.txt in c. Similarly, you can export the settings of different network environments to different configuration files. To access different networks, you only need to use the following command:
Netsh-f c: location1.txt (or: netsh-f c: location2.txt)
In addition, you can configure the network adapter through netsh.exe to automatically obtain the IP address from the DHCP server. The command is as follows:
Netsh interface ip set address "Local Area Connection" dhcp
You can also configure WINS:
Netsh interface ip set wins "Local Area Connection" static 192.168.0.200
You can also use netsh.exe to dynamically obtain DNS settings for the network adapter:
Netsh interface ip set dns "Local Area Connection" dhcp
As you know, netsh.exe is a useful tool for customizing TCP/IP Settings.
I transferred from: http://blog.csdn.net/onlyzhangqin/archive/2008/07/23/2696689.aspx