XP and 2000 Users that Employ Static IPs in One Location and DHCP in Another

Laptop users, particularly in the workplace, often find they need to use their devices with a static IP in one location and DHCP in another. This tutorial contains bat files that allow one to switch from a static IP to DHCP or vice versa with as little inconvenience as possible. The user simply double clicks the appropriate .bat file for his or her location.


The DHCP bat is as follows:
netsh interface ip set address “Local Area Connection” dhcp

The static bat is as follows:
netsh interface ip set address “Local Area Connection” static 127.0.0.1 255.xxx.xxx.xxx 127.xxx.xxx.xxx 1

The first series of numbers is the IP. The second series is the Subnet Mask. The third series is the Gateway, and the last number is the multiplier.

Create these in Notepad, and save them as dhcp.bat and static.bat. They can also be named by location: Topeka.bat and Lawrence.bat.

Use the following .bat to check the configuration after running one of the batch files:

Netsh interface ip show config
pause

The Conversation

Follow the reactions below and share your own thoughts.