IPChanger

ipchanger_edited

I was configuring a bunch of switches the other day. To connect to them I had to be on one subnet, and after the configuration on another. This meant I had to change between two different static IPs on my laptop constantly. To avoid the hassle I wrote this little script.

off
:menu
cls
echo IPChanger
echo --------------------------------------------------
echo 1......Change to Static IP 192.168.1.5
echo 2......Change to Static IP 172.16.19.1
echo 3......Change to IP from DHCP
echo 4......Show current IP

echo Enter Number:

set /p option=
if '%option%'=='1' goto :IP1
if '%option%'=='2' goto :IP2
if '%option%'=='3' goto :IP3
if '%option%'=='4' goto :IP4
pause

:IP1
netsh interface ipv4 set address name="Local Area Connection"
static 192.168.1.5 255.255.255.0
goto :menu

:IP2
netsh interface ipv4 set address name="Local Area Connection"
static 172.16.19.1 255.255.255.0
goto :menu

:IP3
netsh interface ipv4 set address name="Local Area Connection" dhcp
goto :menu

:IP4
netsh interface ip show addresses "Local Area Connection"
pause
goto :menu

Simply copy the text to notepad and save it as IPChanger.bat to make it work.

Please follow and like me:
Bookmark the permalink.

Leave a Reply

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