We may need to work in different networks. It is a cumbersome task to repeatedly modify the IP address over and over again. In addition, the system has crashed, and it is annoying to reconfigure related parameters such as network cards (especially wireless network cards). In fact, clever use of the built-in netsh command in Windows 2000/XP/2003 system, you can quickly switch the IP address, let's take a look at it.
Here are two usages of netsh, copy them to In the text document, change the suffix name .txt to .cmd and double-click it to execute:
The first one is to use the netsh command to modify the computer's IP address, subnet mask, default gateway and DNS. Br>
@echo off
netsh interface ip set address "local connection" static 192.168.0.1 255.255.255.0 192.168.0.254 1
netsh interface ip set dns "local Connection " static 202.194.40.1
netsh interface ip add dns "local connection" 202.194.40.2 2
Note: The part above marked with blue font is required to be modified. section. The second, third, and fourth lines of "local connection" generally do not need to be modified, depending on your computer right-click "My Network Places", select "properties" & rdquo; appears & ldquo; network connection & rdquo; window Depending on the name of the connection, there is usually only one "local connection".
192.168.0.1 255.255.255.0 192.168.0.254 in the second line The three addresses are IP address, subnet mask and default gateway, and they are replaced with the address you want to modify.
202.194.40.1 in the third line is the DNS address, and you can replace it with the DNS address you want to modify.
202.194.40.2 in the fourth line is the secondary DNS address, which is the second one. Replace it with the second DNS address you want to modify. If not, you can put the fourth line. Just delete it.
The second is to use the netsh command to modify the computer's IP address, subnet mask, default gateway and DNS for dynamic access.
@echo off
netsh interface Ip set address "local connection" dhcp
netsh interface ip set dns "local connection" dhcp
Note: This is relatively simple, just modify it according to your computer's situation The blue font is marked with "local connection", and generally does not need to be modified.
The following article is about the detailed usage of the netsh command. After reading it, you will understand some of its other uses.
In Windows 2000, you can use the netsh command to script the following procedure: change the computer's static Internet Protocol (IP) address to a Dynamic Host Configuration Protocol (DHCP) address or vice versa. The netsh command does not require a restart of the computer to complete this task. This feature is especially useful for portable computers that move from one environment to another when it must use a statically assigned IP address in one location and a DHCP-assigned IP address in another location.
The method described in this article is suitable for Windows 2000, Windows XP and Windows Server 2003.
To switch the static address of the specified adapter to a DHCP address, type the following command:
netsh interface ip set address "local connection" dhcp Note: Typing this command will name The "local connection" interface is changed to DHCP.
To display all adapters on your computer and their current IP address to determine the correct adapter name, type the following command: Netsh interface ip show config To change to a static address, type the following command: netsh interface ip Set address "local connection" static IP mask gateway hops such as: netsh interface ip set address "local connection" static 192.168.0.10 255.255.255.0 192.168.0.1 1
Change the DNS to 192.168. 0.1:netsh interface ip set DNS "local connection" static 192.168.0.1 delete gateway: netsh interface ip delete address "local connection" gateway=all delete DNS:
netsh interface ip delete dns " Local connection " all
If the prompt "invalid interface" is specified when performing the configuration, please open the system's "Remote Registry Service" service. Previous123Next page Total 3 pages
Group Policy is a tool for user control system. Users can quickly call up through the running window
With the rapid development of computer hardware, the number of peripheral devices is increasing, key
Sometimes, due to the needs of the operation, multiple software will be launched in
When WinXP reinstalls the system, if you forgot to export the certificate of the backup EFS encrypte
XP's secret weapon to increase the speed of the network: only need a protocol
How to switch the sound of the windwos system switch machine
XP system prompts "Cannot locate program input point MSVCR100.dll" how to solve?
Windows XP set up remote desktop dual administrator login at the same time
How to install fonts in WinXP does not take up hard disk space
The reason for the high CPU usage of WinXP system and the solution
Explain how the windows program works
30 basic tips for computer xp systems
Turn off unnecessary network features in Windows XP
Word document printing tips Raiders: output documents in page order
Win7 with Windows Live, we can also make movies
Dynamic screen saver image production, use "My Documents" to do dynamic screensavers
Win8 keeps the start menu folder
Windows 7 built-in function to adjust the partition is not asking for people
How to close system restore in Win7? How to turn off system restore in
Final Fantasy Zero HD Automatic Avoidance Magic How to Get
Win8 system prompts the exception code C0000005 how to solve?
What software is abbyy finereader?