• Now's your chance win big! Join our community and get entered to win a RTX 2060 GPU, plus more! Join here.

    Pi Cast Episode 3 streams live on Tuesday, August 4th at 2:30 pm ET (7:30 PM BST). Watch live right here!

    Catch Scharon on the Tom's Hardware Show live on Thursday, August 6th at 2:00 pm ET (7:00 PM BST). Click here!

Question changing your PC IP address using BAT file?


Aug 25, 2014
Hi everyone ...

anybody knows how to change IP address of my PC using a BAT file so that if I double click on the bat file it will set the PC IP address statically to some specific IP address ?

Im using a work laptop and since I am moving between office and home I have to do it manually everytime I come to the office where a static IP is assigned to my laptop while its automatic /dynamic in my home ...

thank you in advance.
Been a long time since I messed with this and maybe it is different now with the power shell stuff.

There was a command NETSH SET that let you change a lot of stuff including the IP addresses. I remember it was messy when there were lots of interfaces.


There are a number of ways you can do that including, as mentioned, via PowerShell.

Likely that you will need two scripts: One "Home" and the other "Work". Execute the applicable script while 1) at home or 2) at work.

However, I must second @Wolfshadw - being a work laptop you must check with your IT Team.

You may not even have the necessary admin rights.....