Easily Change Your Static IP to Dynamic (DHCP) in 2 Clicks

 In this post,You’ll learn how to easily reset your IP information from a different batch file.
This tip works in Windows XP/Vista/ 7 / 8.

Why Would You Use This?

Lets say you transport your laptop to and from work. At work you use a static IP and at home you use DHCP. This batch file will automatically change your network settings to DHCP.

How To Use?

  1. Open Notepad or any text editor.
  2. copy/paste this code into it
  3. save the new text file with a .bat extension, for example use “reset-IP-to-DHCP.bat” (don’t remove the double quotes!).

After creating the batch file, just :

  • Windows XP : Double click on it. 

OR

  • Windows Vista / 7 / 8 : Right click and then click on “Execute As Administrator”.
NOTE : The script is very specific to the name of the connection that it is making changes to (in my case, it’s “LAN” – see the picture below ). 


You need to change the name with the one on your computer, it’s usualy “Local Area Connection”.
To get the name of your network connection : go to Network Connection in the Control Panel.

Make a note of the name of the connection that you are anting to control. in my case I am working with the LAN connection.

Get Your Code

@ECHO OFF 

ECHO !——————— _ ————————————!   

ECHO !– Visit our website for more useful Howto’s and tools –!

ECHO !– http://it-n-careerz.blogspot.com/ ——————-!

ECHO !——————— _ ————————————!  

ECHO Resetting IP Address and Subnet Mask For DHCP netsh int ip set address name = “LAN” source = dhcp  

ECHO Resetting DNS For DHCP netsh int ip set dns name = “LAN” source = dhcp 

ECHO Resetting Windows Internet Name Service (WINS) For DHCP netsh int ip set wins name = “LAN” source = dhcp 

ECHO Here are the new settings for %computername%: netsh int ip show config 

pause

    Download

    You can get the file from HERE, just extract the zip file and use it (Yaay!).

    Hungery for More ?

    You can get more details on how the commands above work, and how you can customize them. Just visit this link.

    2 thoughts on “Easily Change Your Static IP to Dynamic (DHCP) in 2 Clicks”

    Leave a Reply to Unknown Cancel 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.