Change Your IP Address Quickly

In the past I have often found myself needing to change my Windows IP Address multiple times while configuring a piece of network equipment. Here is a handy little batch script I have written to set a range of static IP’s quickly. The batch uses the netsh command that is built into windows. Note in the script below that name="Ethernet" refers to the actual interface name as seen in the picture below. You will need to adjust to your the script to your system.adapters

@ECHO OFF
ECHO.
ECHO 1 = Set 10.10 Address
ECHO 2 = Set 172.16 Address
ECHO 3 = Set 192.168 Address
ECHO 4 = Set DHCP Address
ECHO.

set /p input="Enter Selection: "

IF "%input%"=="1" GOTO 10
IF "%input%"=="2" GOTO 172
IF "%input%"=="3" GOTO 192
GOTO DHCP

:10
ECHO Setting 10 Address
netsh interface ip set address name="Ethernet" static 10.10.1.50 255.255.255.0 10.10.1.1 1
GOTO End

:172
ECHO Setting 172 Address
netsh interface ip set address name="Ethernet" static 172.16.1.50 255.255.255.0 172.16.1.1 1
GOTO End

:192
ECHO Setting 192 Address
netsh interface ip set address name="Ethernet" static 192.168.1.50 255.255.255.0 192.168.1.1 1
GOTO End

:DHCP
ECHO Setting DHCP Address
netsh interface ip set address name="Ethernet" dhcp
GOTO End

:End

download-icon Change IP Batch Download

Did you find this article useful? Why not share it with your friends?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.