Posted on Sunday, 23rd March 2008 by Casey
If you are an emerging computer tech and you haven’t already become accustom to using the ipconfig command, you soon will. This command is most commonly used at the DOS prompt to see a computer’s current IP configuration. Using this command with three different switches also allows you to refresh a computer’s network settings which can be very useful when troubleshooting network issues. In the following tutorial, I would like to show you how you can create a batch file that will run this command along with its switches to quickly refresh a computer’s network settings.
Before we get started, it might be helpful for you to first understand what a batch file is. A batch file is a simple text file that can run a series of DOS commands when executed. They can be created using Windows Notepad or any other plain text editor. You simply enter the DOS commands that you would like to run and save the file with a .bat extension. You can then execute it by simply double clicking on it.
Lets get started.
Step 1: Click on the “Start” menu and go to “All Programs”. Go to “Accessories” and open “Notepad”.
Step 2: In Notepad, type in the following commands which will be run to refresh a computer’s network settings.
ipconfig /release
ipconfig /flushdns
ipconfig /renew
It should look like this.

The “release” switch will release your current IP address settings. The “flushdns” switch will flush the DNS resolver cache. The “renew” switch will renew your IP address settings.
Step 3: Now click on the “File” menu and select “Save As”. Change the “Save As Type” field to “All Files” located near the bottom of the window. Now enter a “File Name” such as “Refresh.bat” without the quotes. It is important that you put the .bat extension on the end of the file name or you will not be able to execute it as a batch file. Choose a “Save In” location and click the “Save” button to save it.

Step 4: Now you can run your new batch file by double clicking on it.

After the batch file has finished executing, the computer’s network settings will be refreshed.

You can put this file on your desktop for quick access or on a flash drive to use on other computers. It can be run on any Windows machine including XP and Vista. Remember, these commands will only work if the computer is set up to obtain an IP address automatically and will not work if the computer has a hard-coded IP address.
If you have any experience using batch files, please feel free to share what you use them for.
Related Posts
- How to Create a Windows XP Unattended Installation CD
- How to Create a Windows Vista Unattended Installation CD
- How to Create a Windows Offline Update CD
- How to Disable Windows Vista Permission Security Prompts
- Easily Repair a Corrupt Internet Connection
Posted in How To, Networking, Windows | Comments (5)







April 1st, 2008 at 9:17 pm
Thanks to your idea, I created my own file. (I took out the ascii graphics in the Menu’s).
@echo off
title NETWORK RESET SCRIPT
:prompt
color 1f
cls
echo NETWORK RESET SCRIPT
echo.
echo Type r to Reset Network
echo Type p to do a ping test
echo Type c to go to Command Prompt
echo Type q to exit
set /p answer=
if ‘%answer%’ == ‘r’ goto test
if ‘%answer%’ == ‘R’ goto test
if ‘%answer%’ == ‘C’ goto cmd
if ‘%answer%’ == ‘c’ goto cmd
if ‘%answer%’ == ‘q’ goto quit
if ‘%answer%’ == ‘Q’ goto quit
if ‘%answer%’ == ‘P’ goto ping
if ‘%answer%’ == ‘p’ goto ping
pause >nul
:test
cls
echo —————————————————-
echo - RELEASING IP…. -
echo —————————————————-
ipconfig /release >nul
echo.
echo Done!
echo.
echo —————————————————-
echo - RESETTING IP LOG… -
echo —————————————————-
@netsh int ip reset C:\Windows\TEMP\IPRESETLOG.txt >nul
echo.
echo Done!
echo.
echo —————————————————-
echo - FLUSHING ARP TABLES… -
echo —————————————————-
@arp -d >nul
echo.
echo Done!
echo.
echo —————————————————-
echo - FLUSHING DNS… -
echo —————————————————-
@ipconfig /flushdns >nul
echo.
echo Done!
echo.
echo —————————————————-
echo - RENEWING IP… -
echo —————————————————-
@ipconfig /renew >nul
echo.
echo Done!
echo.
cls
echo —————————————————-
echo Heres Your Status: -
echo —————————————————-
ipconfig /all
echo.
echo Press Any Key to Go To Menu
pause >nul
goto prompt
:ping
cls
echo —————————————————-
echo Starting Ping Test… -
echo —————————————————-
echo.
ping google.com
echo.
echo Press Any Key to goto MENU
pause >nul
goto prompt
:quit
cls
echo Thanks For Using The Network Reset Script
pause
exit
:cmd
@color 7
cls
cmd
@echo on
April 6th, 2008 at 9:01 pm
Wow, thanks for sharing this with us. I created one on my computer and it worked like a charm. I love the menus and even the change of color.
June 8th, 2008 at 9:15 pm
Hi, I just created the refresh.bat with your instructions and found out that it does not work if I just double click it in Vista. I have to actually right click and use the ‘Run as adminstrator’ option to get it to work.
Is there any way around this? I do not want to diable my UAC function in my Vista, just thinking of creating something like a special permission thing for this particular refresh.bat.
Thanks!
July 10th, 2008 at 7:38 am
add this to the front of the batch file:
runas /user:local\administrator
it will prompt you for the admin password. It just does the run as part for you.
September 11th, 2008 at 1:06 pm
This is wonderful. Thanks fellas.