|
JIU Xue training network-the largest training platform in China! Free course release, demand, search for courses, lecturers, institutions Training courses: Computer, English, Japanese, enterprise management, occupational, French, software, driving, oral English, logistics, chefs, networking, networking, beauty, talent, accounting, stocks, dance... |
Recently, I was transferred to Shanghai Telecom to create a project. Due to the inconsistency between the IP address segments of China Telecom and the home, I sent a message every morning to open the network neighbors and modify the IP addresses one by one. If you cannot remember it, ask someone else or open the Telecom IP segment, gateway, DNS... back home in the evening, I repeated the same thing, so I thought there was a more convenient way to solve it with a batch processing? After my exploration, I found a method and did not dare to exclusive use it out...
Create a txt file on the desktop and write the following content:
Netsh interface ip reset "lan"
Netsh interface ip add address "lan" 192.168.1.3 255.255.0
Netsh interface ip add address "lan" gateway = 192.168.1.1 gwmetric = 1
Netsh interface ip set dns "lan" static 202.96.209.6 primary
And save the name as "bat. Double-click it to run the command. In this case, run the IPConfig command or open the local connection of the network neighbor. It is found that the relevant attributes have been changed.
Note:
The first line indicates that the local connection named lan is set to null.
"Lan" indicates the name of the local connection (such as "local connection 1 ").
The format of the second line is to add an IP address and subnet mask.
Netsh interface ip add address local connection name IP subnet mask
Row 3
Netsh interface ip add address "lan" gateway = 192.168.1.1 gwmetric = 1 increase the number of hops from the local machine to the gateway
Gwmetric can use the tracert gateway IP command to get a few hops and write a few hops. Generally, there is only one hop in the LAN, so gwmetric = 1
The fourth line sets the first DNS
Then, use the same method to create a batch processing program for Shanghai Telecom. bat.