Share this post

Tags

Simple batch file to renew IP address

Many IT professionals have needed to change IP address more often than average PC user.

To make this step much more easier than it is – instead of using MS Network Settings – try to make batch file and start changes on double mouse click.
As you know – to renew currently used IP address you must start cmd and type ipconfig /renew command. Also, to release those IP addresses in cmd type command ipconfig /release and hit enter.
To use these commands with a double mouse click you can make yourself a batch file and execute them without typing each command every time.
Simply open New Text file and write these commands inside

@echo off

Ipconfig /renew

Ipconfig /release

Now save your file as a batch file. To do that, go to Save As and name that file something like ipreset.bat with quota marks and you’ll get batch file which you can execute by double mouse click.

ipreset batch file

Take a closer look at the picture to see how to make batch file from *.txt file.
Inside this file you can write other commands you need or just make another batch file for those tasks.
Now you know how to make batch file and how to execute cmd commands from it. Let’s see some more powerful examples of using this file and setting your Network.
Sometimes you won’t be able to do Network Settings only by commands shown above. To make even more complex batch file and setup Network with more than just one IP address you will need netsh command.

Take a look how this command works. Like on example in this post, you need to make batch file and write code inside

Netsh in tip add address “local area connection” 192.168.1.100 all

This line of code will write IP to your Network Settings under local area network.