Quickest way to change an IP in windows
Quite often at work we need to manually change the IP of our laptops for testing various things. Since our laptops are not the quickest around town I quickly got bored of clicking on 5 different windows just to change IP. The I found the quite useful
netsh interface ip set address name="Local Area Connection" static IP MASK GATEWAY 1
The above command would change the IP on the interface “Local area connection” to whatever values of IP/MASK?GATEWAY you define. Typing all that in rather than clicking (and waiting) for a few windows is maybe not as good so I’ve made a very simple bat script.
- Will ask for IP, mask and gateway then configure “Local Area Connection” and display its config to confirm
- Will configure “Local Area Connection” for DHCP then display the address it uses
- Manually configure the DNS servers used
- Show the current interface config
- Will relese and renew the DHCP address on “Local Area Connection”
- Asks for an address and pings it continually
- Asks for an address and pathpings to it (similar to traceroute)
Has worked for me in 2000, XP and windows 7 with no problems. It is provided as is though and you should use at your own risk etc. If you find any problems or suggestions I’d be happy to hear them. Grab the script [here] (the password is www.m00nie.com to work around the problem of bat files being on the naughty list).