In Windows 7, how does one automatically set static IP addresses and gateways?

Source: Internet
Author: User

Reference: http://caoxuhuan.iteye.com/blog/973625

Because the dormitory and lab must be bound with the static IP address of the machine to access the Internet, it is very troublesome to manually change the IP address and gateway in the "Network and sharing center, so I want to have an automated method for processing. The best solution is to have two icons on the desktop. Double-click any icon to easily complete the network configuration. Step 1: understand the principle of automatically setting IP addresses. Run the following command in cmd:

Netsh interface IP Set address name = "Local Area Connection" Source = static ADDR = 192.168.104.67 mask = 255.255.255.0 gateway = 192.168.200.11 modify the above command to set it to the corresponding IP address. in this example, cmd.exe needs to run as administrator. Step 2: Package the command into a bat file Enter a new TXT file in any folder: Netsh interface IP Set address name = "Local Area Connection" Source = static ADDR = 192.168.104.67
Mask = 255.255.255.0 gateway = 192.168.200.11 Save and exit. Then change the suffix of the. txt file to. bat. Send the. BAT file to the desktop. Right-click the. Bat shortcut icon on the desktop and choose Properties. On the shortcut cut tab, click Advanced... to check the run as administrator. Save and exit. In this way, every time you double-click the XXX. BAT file on the desktop, it will log on with the Administrator's identity card and automatically set the IP address and gateway.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.