[SOLVED] changing your PC IP address using BAT file?

radwan3

Honorable
Aug 25, 2014
34
0
10,530
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.
 
Solution
Do you have both a wired and wireless interface on the laptop? If so, you can set one to the static and the other to a dynamic setup, ie wired static and wifi dynamic.
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.
 

Ralston18

Titan
Moderator
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.....