Monday, August 27, 2012

Ipconfig: /Release /Renew Batch/Script File

Have you ever been sitting at a remote site, troubleshooting an issue from a PC on 'their' network, and you needed to release and renew the IP address of the PC you are controlling?  Well, what happens when you release the IP address?  You get kicked off and then you have to call someone there onsite and have them renew and then tell you the new IP address.  Well, here is something you can do.  One of my clients and I were talking about this, and we decided we could do this without anyone's intervention.  We decided to write a simple batch file.  We went into Notepad and wrote this in:

ipconfig /release
ipconfig /renew

Then when I went to save the file, we put this in as the name of the file: "renew.bat"
Yes, use the quotes too.  It works well for what we needed to accomplish.  We did a Wireshark capture to verify this was actually working the way it was supposed to, since it was working way too fast for us.  If you look at the time stamp, it takes less than two seconds for completion.